classumlaggregationclass-diagrammultiplicity

Class diagram multiplicity and implementation


After reading a lot, I was quite confident when it came to class diagrams. Yet I do not understand the following:

ChessManSet-<>----------16-ChessMan

Why is there not 0..16? Player can loose his chessman. This was displayed in a model done by a respected designer in my company and when I asked about that, he said only "they still belong to him". So I'm a bit confused, I would expect that to be implemented as a list which obviously could decrease in its size from 16 to 0.


Solution

  • The only sure thing is that according to your model or design in the implementation you will always have 16 chessman instances. Of course you can choose to implement a list which could decrease from 16 to 0 but, as you said, you have to change the cardinality from 16..16 to 0..16.