12

What is an example of Navigability in UML diagrams? My professor has provided the follow figure, but I can't seem to figure it out:

enter image description here

Christophe
  • 68,716
  • 7
  • 72
  • 138
Peter Tao
  • 1,668
  • 6
  • 18
  • 29
  • 3
    That's the wrong kind of arrowhead. The one you have means "extends" and is only used to define stereotypes. – Jim L. Mar 25 '17 at 10:57
  • @JimL. Actually you are right. However, many (most?) UML users don't see those minor arrow differences (me neither even after so many years of using UML). They just see the navigability in this. Also some UML modeling tools (do not ask me which) but definitely some UML drawing tools use "artistic" arrows which more resemble a whale spear head than any of the approved UML arrows. Honestly, even the UML spec uses bad connector notation (when it comes to dashes) at quite some places. – qwerty_so Dec 04 '18 at 20:36
  • For class diagrams, the main types of lines/arrows are: (a) Solid line with open arrowhead: *navigable association*. (b) Solid line with closed, hollow arrowhead: *class inheritance/generalization*. (c) Dashed line with open arrowhead: *dependency*. (d) Dashed line with closed, hollow arrowhead: *interface realization*. – Paulo Merson Dec 01 '20 at 18:20

2 Answers2

15

This shows navigability. A can see (means it has an attribute referencing) B. In contrast B has no idea about/reference to A. As @JimL commented, your arrow is wrong and only used for stereotype definition. I'm referring to the unfilled arrow which indicates navigability of associations from which I assume you actually meant that.

UML 2.5 spec p. 18:

  • Arrow notation is used to denote association end navigability. By definition, all class-owned association ends are navigable. By convention, all association-owned ends in the metamodel are not navigable.

  • An association with neither end marked by navigability arrows means that the association is navigable in both directions.

And even more relevant p. 200:

enter image description here

Navigability notation was often used in the past according to an informal convention, whereby non-navigable ends were assumed to be owned by the Association whereas navigable ends were assumed to be owned by the Classifier at the opposite end. This convention is now deprecated. Aggregation type, navigability, and end ownership are separate concepts, each with their own explicit notation. Association ends owned by classes are always navigable, while those owned by associations may be navigable or not.

So you should use the dot notation instead:

qwerty_so
  • 35,448
  • 8
  • 62
  • 86
4

The UML specs is an intricate pile of alternative notations that can drive you crazy. Explore with caution!

In real life, KEEP IT SIMPLE! Don't use "dot notation" and don't use x to denote non-navigability, unless your peers are familiar with it.

Use arrows for navigable associations. People are familiar with it, or if not they're intuitive enough.

basic UML class diagram navigability notation

Paulo Merson
  • 13,270
  • 8
  • 79
  • 72
  • 1
    Hi, could you elaborate on purchase order can see product? – User 19826 Nov 01 '21 at 05:26
  • @Fabiana The Purchase Order class has an attribute that is a collection of Product objects. So, the business logic inside Purchase Order has access to Product objects. OTOH, Product has no attribute or syntactic reference to Purchase Oder. – Paulo Merson Nov 01 '21 at 16:52