Thursday, November 7, 2013

ArgoUML Notation


When double clicking on a text on the diagram, such as an attribute of a class, ArgoUML allows you to modify the model or create a new model element by editing the text. ArgoUML calls this textual representation of a UML model element "Notation".


E. g. you could double-click on the empty attribute compartment of a class, and type:
name : String
This creates a new attribute with the given name and type.

Or something a bit more complex:
+name [0..1]:String = “Name” {changeable}
The above shows the visibility, name, multiplicity, type, initial value and properties. You see, this is a quick way to set many properties of an attribute at once.

In ArgoUML, typing text on the diagram is the easiest way to enter many attributes for one class: You can enter more than one attribute on one line by separating the attributes with a semi-colon. Enter e.g. (all on one line):
id: Integer; firstName: String; lastName: String; birth: Date; address: String
Editing notation is possible for most common ModelElements, but not for all. Try it out by double-clicking on the text in any ArgoUML diagram.

While editing, the status-bar at the bottom of the window shows (most of) the possible syntax in BNF notation. E.g for an attribute it reads:


["/"] ["<<" stereo ">>"] [ "+" | "-" | "#" | "~" ] name [ "[" multiplicity "]" ] [ ":" type ] ["=" initial-value] ["{" property "}"]

The meaning of all these properties is explained in any good documentation of the UML.