Search code examples
umlclass-diagramdomain-modelstaruml

Are these two uml arrows equivalent?


enter image description here

Are these two associations conceptually equivalent? My textbook uses the second type but my uml software is only able to generate the first type of associations.

Thanks!


Solution

  • No, they are not equivalent.

    The first one indicates navigability and shows that A is an attribute of B (or to be more specific, B has some one attribute of type A). You could replace it with putting in B an attribute of type A, i.e. adding in B class an attribute compartment with a line containing: :A

    The second one is a hint about the order in which you should put classes when reading the meaning of the association, i.e. in your case who owns whom. If from class names it's not clear wether A owns B or B owns A, then you're arrow tells you that it's B owns A.

    You could have B owns A (so with the small triangle as in your diagram) but put B as an attribute of A (so arrow end on opposite end of association than in your second picture).

    Please refer to

    • Fig 11.27 on p. 202 of the UML 2.5 specs
    • Table on p. 718.