Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

UML Class diagram: difference between Navigation and Ownership

I read the posts in

  • association owned by classifier and association owned by relationship in UML
  • Setting the association end ownership in UML: What does it mean with respect to generated code in visual paradigm (or in other UML tools)?
  • http://www.uml-diagrams.org/association.html

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.

  1. 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?

  2. 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?

enter image description here

like image 616
user3579222 Avatar asked Aug 09 '17 16:08

user3579222


People also ask

What is navigation in UML?

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.

What's the difference between UML diagrams and class diagrams?

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.

What is the difference between class diagram and design class diagram?

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.

What is Aggregation relationship in UML?

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.


1 Answers

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.

like image 179
qwerty_so Avatar answered Nov 13 '22 11:11

qwerty_so