Multiplicity
Associations
noreferences
@@tooltip Multiplicity: Specifies the number of connected objects allowed at each end of a link (the run time instantiation of an association)

@@description
<p>Multiplicity describes the allowable number of entities that can participate in one end of an association.
In most cases you provide both a lower and upper bound, but the "many" (or "*") case assumes a zero
lower bound.</p>

<p>The most common cases are:
<ul>
<li>* meaning 'any number' or 'many'; i.e. from 0 to whatever number the computer can handle.
<li>1 meaning 'mandatory', i.e. exactly one.
<li>0..1 meaning 'optional', i.e. a lower bound of zero, and an upper bound of one.
<li>1..* meaning 'mandatory many', i.e. a lower bound of 1 and an indeterminate upper bound.
</ul>
</p>

<p>Multiplicity must be specified for both ends of an association. At run time, code generated by Umple will ensure that the lower bounds and upper bounds are respected. Also the multiplicity determines <a href="APISummary.html">which methods will be generated in the API</a> for the model. For example, when * is specified, methods are generated to access all the associated objects, and to access an object at a specific index. The number of objects linked at run-time is called 'cardinality'.</p>

<p>If multiplicity is specified incorrectly, the compiler will generate an <a href="E004InvalidMultiplicity.html">error message highlighting the line with the multiplicity error.</a></p>

&nbsp; <br/>

@@syntax
[[multiplicity]]

@@example @@caption 'Mandatory many' example @@endcaption
@@source manualexamples/Multiplicity1.ump
@@endexample

@@example @@caption Example with lower and upper bounds @@endcaption
@@source manualexamples/Multiplicity2.ump
@@endexample

@@example @@caption Example with single integer multiplicity @@endcaption
@@source manualexamples/Multiplicity3.ump
@@endexample
