Direction of the association arrow in UML class diagrams

52,422

Solution 1

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

UML Arrow association direction

Taken from: http://www.uml-diagrams.org/association.html

Solution 2

Its because an order "has a" reference to a customer.

In a database, this would be a foreign key in the order-table, which stores the customer-id.

In code, you would store a reference to the associated customer object in an order object. So the order is pointing to the customer and not vice-versa.

Solution 3

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

alt text

If one role is navigable and the other is not, an arrow appears (7) on the association in the navigable direction.

Solution 4

The arrows describe the ways you can navigate. So in this diagram you can go from order to customer. And for the other way: no arrow means NOT "not navigable", but "no comment". There is no definite right way to do it.

Share:
52,422

Related videos on Youtube

neuromancer
Author by

neuromancer

Updated on July 09, 2022

Comments

  • neuromancer
    neuromancer almost 2 years

    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?

    UML Tutorial - Class Diagrams

  • Jordi Cabot
    Jordi Cabot over 14 years
    This is not a dependency. A dependency is not a special typ of association, it is a special type of Relationship (in the same way as association is another type of Relationship)
  • Pete Kirkham
    Pete Kirkham over 14 years
    associations do not always correspond to UML attributes and definitely do not correspond to attributes on Java classes (there's no such thing in Java, so using 'attribute' in a Java context could mean field or property or bean property).
  • Iman Mahmoudinasab
    Iman Mahmoudinasab over 10 years
    Why we shouldn't decide customer has many orders and add collection reference of order to customer?
  • Geomorillo
    Geomorillo over 5 years
    this should be the right answer others never explained what navegability is