1

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?

mosquito87
  • 4,270
  • 11
  • 46
  • 77
  • 1
    What do you mean by "implemented by an object". An object is an instance, not an implementation. – qwerty_so Feb 07 '15 at 17:29
  • Should I have said "realized"? I want to show that the 1st association is done by the variable pickupAddress (type address) and the 2nd association is done by the variable handoverAddress (type address). – mosquito87 Feb 07 '15 at 18:01
  • If you replace implemented by realized it's the same. The culprit is "object". An object is an instance of a class. Some "real" stuff. Inheritance of associations can be shown by the corresponding properties (which are just a different rendering). Basically do what @Vladimir suggests. – qwerty_so Feb 07 '15 at 19:10
  • I suppose you'll want something more sophisticated in between these classes than two associations. Probably you need something like "Shipment" (or Order). Otherwise each article can be sent out only once. – observer Feb 09 '15 at 14:26

2 Answers2

2
  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.
sfinnie
  • 9,854
  • 1
  • 38
  • 44
Vladimir
  • 2,066
  • 15
  • 13
1

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

Xaelis
  • 1,609
  • 10
  • 17
  • You should replace the naviagbility arrows with association end ownership dots (defined only in UML 2.5) for expressing the fact that the two association ends ' pickupAddress' and ' handoverAddress' correspond to two reference properties of the class `Article`. Naviagbility arrows do not really express this. See http://stackoverflow.com/questions/21321446/is-there-a-free-uml-class-diagram-editor-that-supports-association-end-ownersh – Gerd Wagner Feb 09 '15 at 09:16
  • Again, you can also look at qualified associations. – BobRodes Feb 09 '15 at 18:17