mosquito87
mosquito87

Reputation: 4440

Describe associations in class diagram

I have the following classes:

The relationships of those two classes are:

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?

Upvotes: 1

Views: 188

Answers (2)

Vladimir
Vladimir

Reputation: 2119

  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.

Upvotes: 2

Xaelis
Xaelis

Reputation: 1599

The solution is something like this:

Article with two delivery addresses

Depending if the addresses are shared by articles or not, you should change the aggregation type. You could make a copy and edit this model there

Upvotes: 1

Related Questions