问题
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:
回答1:
This shows navigability. A
can see (means it has an attribute referencing) B
. In contrast B
has no idea about/reference to A
.
UML spec:
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:
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:
来源:https://stackoverflow.com/questions/43012322/what-is-navigability-in-uml-diagrams