I am confused about the cardinality/ multiplicity when designing class diagrams. My main confusion is when to represent 1---* relationship. For ex in case of passenger and seat classes, passenger will be allotted to one seat, where as the seat can be allotted to one passenger at A POINT IN TIME but over a period of its existence it can be allotted to many passengers.
So should the seat--->passenger be 1-1 or 1-*?
Let's summarize:
Passenger
will be allocated to exactly one Seat
(1). Open question: does the Passenger
exists already before the allocation (i.e. 1 or 0..1) ? Seat
can have one allocated Passenger
but it may remain empty (so 0..1) Passenger
can have been allocated to many seats (one per flight)Seat
can have had many Passenger
allocated. Conclusions: the relation between Seat
and Passenger
is *-*
(many to many)