uOttawaUniversity of Ottawa - Canadas University
list of dots

Umple User Manual    [Previous]   [Next]   

Loading

Independently Defined Associations

An association can be defined separately from the any class. Contrast this with the Umple code showing the same model with inline associations.

Example


class Group { }
class Item {}
class Description {}

association {
  * Group -- * Item;
}

association {
  1 Group -> 0..1 Description;  
}
      

Load the above code into UmpleOnline

 

Syntax


// Associations can be declared outside the body of classes.
// See user manual page IndependentlyDefinedAssociations
associationDefinition : association [name]? { ([[comment]] | [[association]])* }

association : [=modifier:immutable]? [[associationEnd]] [=arrow:--
    |->
    |<-
    |><
    |<@>-
    |-<@>] [[associationEnd]] ;

// note: gpIdentifier = general parameter identifier
associationEnd : [[multiplicity]] [=gpIdentifier:%]? [type] [~roleName]? [[isSorted]]?

association : association [associationNum];