list of dots Digital Research Alliance of Canada logo  NSERC logo  University of Ottawa logo / UniversitĂ© d'Ottawa

User Manual    [Previous]   [Next]   

Inline Associations

An association represents a relationship between two classes. Associations can be defined within a class, in a similar manner as you would define an attribute.

Contrast this with the same model defined using independently defined associations.

Example


class Group 
{
  // a many-to-many association
  // An item has zero or more groups and a group
  // has zero or more items
  * -- * Item item;
  
  // An item has an optional description
  // The association is directed, so descriptions
  // do not know which groups link to them
  1 -> 0..1 Description;
}

class Item
{}

class Description
{}
      

Load the above code into UmpleOnline

 

Syntax


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

inlineAssociationEnd : [[multiplicity]] [~roleName]? [[isSorted]]?

associationEnd : [[multiplicity]] [type] [~roleName]? [[isSorted]]?