Search code examples
uml

Does it make sense to specify multiplicity on a non-navigable end of a class association ? [UML]


For instance, would the 0..* make sense here? (no matter the classes)enter image description here


Solution

  • Yes, it makes sense, but it is not required. The multiplicity 0..* tells the reader that there are no restrictions on the amount of instances of Class1 that refer to a particular instance of Class2. If it would be 2..3, you convey that only 2 or 3 instances of Class1 will be associated with any instance of Class2.

    Navigability is about runtime efficiency, whereas multiplicity is about the number of instances participating in the association. These are two independent properties of the association.

    According to the UML 2.5.1 specification, section 11.5.3.1:

    If an end is not navigable, access from the other ends may or may not be possible, and if it is, it might not be efficient.