uOttawaUniversity of Ottawa - Canadas University
list of dots

Umple User Manual    [Previous]   [Next]   

Loading

W036 Unmanaged Multiplicity

Umple semantic warning generated when a directed association has a multiplicity with hard constraints

Umple generates code to manage the manipulation of the directed end (with the arrowhead) of a directed association. However there are no inverse references in such a case. In the example below, there are no references from class B to class X. As a result, the multiplicity on the undirected end is purely 'documentation'.

Specifying a hard constraint such as 1 or 2 for the upper or lower bound in such a case may be misleading and is typically incorrect. This error is raised whenever the multiplicity is other than * or 0..1

Example

// The following will generate this warnbing

class X {
  1 -> * B first;
  1..3 -> * B second;
  0..2 -> * B third;
}

class B {}

      

Load the above code into UmpleOnline

 

Another Example

// The following solves the problem by either making the association unndirected
// or making the bounds have soft constraints

class X {
  0..1 -> * B first;
  * -> * B second;
  0..2 -- * B third;
}

class B {}


      

Load the above code into UmpleOnline