uOttawaUniversity of Ottawa - Canadas University
list of dots

Umple User Manual    [Previous]   [Next]   

Loading

E021 Invalid Reflexive Association

Umple syntactic error reported when a class has a reflexive association (an association with both ends the same) but there is neither a role name (indicating it is asymmetric), nor a 'self' keyword (indicating it is symmetric).

Code cannot be generated for asymmetric reflexive associations unless there is a role name at at least one end. This ensures the generated API has distinct words for each end.

For more information about reflexive associations, see this page.

Example

// The following example shows how to generate this error.
class X {
    0..1 -- 0..1 X;
}

      

Load the above code into UmpleOnline

 

Another Example

// The following example shows how to fix the error if this is an asymmetric association.
class X {
    0..1 -- 0..1 X right;
}

      

Load the above code into UmpleOnline

 

Another Example

// The following example shows how to fix the error if this is a symmetric association.
class X {
    0..1 self right;
}

      

Load the above code into UmpleOnline