Problem Analysis  «Prev  Next»
Lesson 9Basic object modeling: multiplicity
ObjectiveDefine multiplicity as it applies to basic object modeling.

Basic Object Modeling using Multiplicity


To complete each association, you need at least to assign multiplicity. Multiplicity simply means the number of objects that participate in the association. Assign two separate values, one at each end of the association. Ask the question
"How many objects of this class are associated with one object of the other class?"
Then switch to the other end of the association and ask the question again.

An example of multiplicity

Using the course project example again, you would ask "How many seats can be held by one customer?" If the answer is none or a lot, show this by placing the multiplicity 0..* on the Seat end of the holds association.
How many seats can be held by one customer

Your next question would be, "How many customers can hold the same seat?"
To answer this question, you have to choose a time frame. Remember the three questions used for abstraction.
  1. What is the context?
  2. What time frame do we need to support?
  3. How much detail do we need to support?

Let us go with a point in time for this example.
In that case, the answer would be "one at a time." The multiplicity would be 0..1: No one or only one customer may hold the same seat at the same time.
How many customers can hold the same seat?