Logical View  «Prev 

Modeling associations Customer Order

When you model a system, certain objects will be related to each other, and these relationships themselves need to be modeled for clarity. Association is a relationship between classifiers, which is used to show that instances of classifiers could either be
  1. linked to each other or
  2. combined logically or
  3. physically
into some aggregation.

Start with the class diagram of Customer and Order. The association shows one customer places zero or more orders.

To look up a customer's orders individually, identify a field that will uniquely identify the order. The attributes reveal the ordernumber to be a unique identifier.

Place the qualifier box next to the class that will use it. The customer objects need to look up unique orders by ordernumber, so place the qualifier box next to the customer class.

Next copy the ordernumber attribute name and data type and place them in the qualifier box

Reduce the multiplicity to show that the order number qualifier allows use to reference exactly on order at a time. The multiplicity is reduced to 1 because the qualifier is a unique value. If the qualifier is not unique then it remains zero or more (*), but the actual number of objects decreases.