Search code examples
umlclass-diagram

Describe associations in class diagram


I have the following classes:

  • Article
  • Address

The relationships of those two classes are:

  • Article 1->2 Address (1 and 2 are the multiplicities, so an article has two addresses (a pickup & delivery address).

How can I show in the class diagram that those two associations to the address are implemented by an object called pickupAddress and handoverAddress and that handoverAddress is optional? Is that even possible?


Solution

    1. You must draw two associations between Article and Address. Role of address for the first association is pickup and for the second one is delivery.
    2. If handover address is optional, multiplicity of association should have lower bound set to zero and upper bound 1. Pickup Address is multiplicity 1 according to your question (i.e. mandatory & exactly one).
    3. Implicitly, association is implemented by classes at the association ends or by association instance (link). There is possible to define, what element owns association end, Association or Class at the association end. Read UML Superstructure document to get more info. See property at association end chapter.