I would like to know once and for all how to write UML cardinalities, since I very often had to debate about them (so proofs and sources are very welcome :)
If I want to explain that a Mother
can have several Child
ren but a Child
has one and only one Mother
, should I write:
Mother * ---------- 1 Child
Or
Mother 1 ---------- * Child
?
What does 1 * mean in UML? If you have 1.. * on the Class end that means that a Student has at least 1 and possible more Classes . 0.. * on the Class end means that a student could also have no Classes at all.29-Dec-2015.
The "0.. *" notation is used to denote "zero or more" (many). The following notation indicates that every object in Class A is associated with zero or more objects in Class B, and that every object in Class B is associated with exactly one object in Class A.
When you make changes to a model, an asterisk (*) appears beside the model name in the Project Explorer view, indicating that the model has unsaved changes. If you have the model open in the Model Editor view, or diagrams open in the diagram editor, an asterisk appears beside the name on each tab.
the second one Mother 1 ----------------- 1..* Child
You would find many example in the UML specification for all figure related to the Abstract Syntax...
Of course Red Beard is right, the correct answer is the second one.
As for a tip for remembering this, I advise to think in english: You say "A child has ONE mother", and in this sentence like in UML, ONE is written next to Mother. Fairly simple.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With