I read the posts in
but the difference between "navigation" and "ownership" of associations of UML class diagrams is still unclear to me. Moreover, UML 2.5 was released in the meantime.
The specification states the following:
Association ends owned by classes are always navigable, while those owned by associations may be navigable or not.
This means, that the example c below is invalid. Examples a and b are valid, in both cases the right end is navigable. However, in example b the left end is not navigable.
Am I right?
What is the semantic difference between navigation and ownership? Is navigation a "generic" way of accessing the opposite class while ownership enforces a class to have an attribute?
Navigability means according to the UML specifications: that instances participating in links at runtime (instances of an Association) can be accessed efficiently from instances at the other ends of the Association. The precise mechanism by which such efficient access is achieved is implementation specific.
The main difference between UML and class diagram is that the UML is a general-purpose visual modeling language that helps to visualize, construct and document software systems while class diagram is a type of UML diagram that represents the static view of an application.
The main difference between analysis class diagrams and design class diagram is the analysis phase focus on designing a class diagram without concerning about the implementation detail. where as, desgin modelling concern with the implementaion and architechture since, it the high-level static view of the system.
In UML models, an aggregation relationship shows a classifier as a part of or subordinate to another classifier. An aggregation is a special type of association in which objects are assembled or configured together to create a more complex object.
The specs say
Dot notation is used to denote association end ownership, where the dot shows that the Class at the other end of the line owns the Property whose type is the Class touched by the dot.
So a and b are valid and c is strange. Assuming left begin class A
and right being class B
. In case a A
owns a property that is of type B
and thus it can navigate to it. Case b explicitly adds the information that A
can navigate to B
which is already obvious by using the dot. In case c B
owns a property of type A
(and therefore can navigate). Additionally you indicate navigation from A
to B
without showing ownership. So that's strange.
Ownership just says there is something (a pointer) to navigate to the other object. To cite the specs (p. 126):
Navigation arrows may be shown, but if shown, they shall agree with the navigation of the Association’s ends.
and later (p. 201):
In practice, it is often convenient to suppress some of the arrows and crosses that signify navigability of association ends. A conforming tool may provide various options for showing navigation arrows and crosses. As with dot notation, these options apply at the level of complete diagrams.
- Show all arrows and crosses. Navigation and its absence are made completely explicit.
- Suppress all arrows and crosses. No inference can be drawn about navigation.
- Suppress all crosses. Suppress arrows for Associations with navigability in both directions, and show arrows only for Associations with one-way navigability. In this case, the two-way navigability cannot be distinguished from situations where there is no navigation at all; however, the latter case occurs rarely in practice.
Navigation does not have a real use (in most cases). You show navigation by adding role names which make clear that A
sees B
as role
. There's a notation with a cross near the end which explicitly forbids navigation. This might be useful in some cases.
It might be noted that the specs are rather silent about "navigation" (just grep the occurrences) compared to "ownership" (which is used quite a bit more). This is probably to account to the fact that the ownership had been introduced recently.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With