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

User Manual    [Previous]   [Next]   

MultiValued Attributes

As in UML, Umple allows one to specify an attribute with multiple values.

We encourage the use of association notation in this context, however the attribute notation can be useful sometimes.

Initialization of multivalued attributes is also allowed, as shown in the example.

Example

class Office {
   Integer number;
   Phone[] installedTelephones;
   String[] emails = {"abc@umple.org", "def@umple.org"};
   Integer [] incomingNumbers = {765432, 987654};
} 

class Phone {
  String digits;
  String callerID;
}
// @@@skipcppcompile

      

Load the above code into UmpleOnline

 

Syntax


multivaluedAttribute- : [=unique]? [=lazy]? [=ivar]? [=modifier:immutable
    |settable
    |internal
    |defaulted
    |const
    |fixml]? [type]? [[list]] [~name]
  (= { [**value] }
  )? ;