11.1.1 An incorrect, but useful overview
In most cases, you get enough information if you master the core types entities that model an object-oriented system. These are Namespace, Package, Class, Method, Attribute, and the relationships between them, namely Inheritance, Access and Invocation. The figure below provides an overview of these classes.
This is an incorrect overview from two points of view:
- It does not show all entities. For example, a Method has also a Parameters and LocalVariables.
- At places, it shows direct relationships when in reality they happen through inheritance. For example, the Access points to an Attribute, while in reality it points to a superclass (StructuralEntity).
However, while incorrect, this picture is also useful because for most practical purposes it is all you need. Let us go through it step by step.
First, please note the missing arrows on the associations. This is not a mistake. In FAMIX, all associations are bidirectional. Let us take an example. Given the model from our running example (see Chapter 3), we have:
aClass := model allClasses entityNamed: #'org::argouml::ui::Critic'.
aClass methods first parentType == aClass
"--> true"
In other words, we can navigate from a class to its methods and back using only unary methods. Furthermore, these relationships are cached in the entities, and thus the traversal works fast.
The reason for this mechanism is that we want to offer the possibility of traversing the model from any point to any point. This is particularly useful when we want to use the API as a query language.
naming convention for attributes
difference between namespace and package

