On this webpage which shows how to draw a class diagram, why is the arrow for association pointing from order to customer, and not from customer to order?
7 Answers
The arrows describe navigability.
- Navigable end is indicated by an open arrowhead on the end of an association
- Not navigable end is indicated with a small x on the end of an association
- No adornment on the end of an association means unspecified navigability
Taken from: http://www.uml-diagrams.org/association.html
This might help:
UML Class Diagrams: Guidelines: http://msdn.microsoft.com/en-us/library/dd409416%28VS.100%29.aspx
Properties of an Association
Is Navigable: If true for only one role, an arrow appears in the navigable direction. The association can be read in this direction. You can use this to indicate navigability of links and database relations in the software.
Properties of Associations in UML Class Diagrams: http://msdn.microsoft.com/en-us/library/dd323862%28VS.100%29.aspx
If one role is navigable and the other is not, an arrow appears (7) on the association in the navigable direction.
Association ends have a boolean navigability property in UML. In this case, the navigability in the direction order to customer is set to true while the navigation in the direction customer to order is set to false.
With this, the designer of the model expresses that orders now who is the customer associated with the order but customers do not have direct access to their orders.
If we look at the Java code for this model, navigability it is easier to understand. For this example, this navigability means that Order has an attribute of type Customer but Customer has no collection attribute to store his/her orders