E.1 Syntax Changes


E.1.1 Context Declaration

In version 1.1, there was no syntax for declaring the context of an expression; there was only the convention to underline the classname (for invariants) or the operation name (for pre- and postconditions) to indicate the context. In version 2.0, the context declaration is formalized . A new syntax is provided using the keyword context , and several different keywords indicate how the expression should be interpreted, e.g., inv and derive .

E.1.2 Enumerations and Class Attributes and Operations

The syntax for specifying enumeration types has changed from UML 1.1 to UML 2.0. In the current version, enumeration types are specified more or less like other types are denoted. In correspondence, the OCL syntax for using enumeration values has been changed. An enumeration value in OCL version 2.0 must be written as follows :

 EnumTypeName::EnumLiteralValue 

The syntax for using class attributes and operations has also changed. They must be prefixed by the classname and two colons, as in the following:

 ClassName::StaticAttribute 

E.1.3 Missing Rolenames and Using Association Classes

In version 1.1, you indicated an association for which the rolename is missing by stating the classname, starting with a lowercase letter. This is changed because it cannot be done in non-ascii typefaces . The syntax in version 2.0 is simply the classname as is.

The syntax for accessing an instance of an association class is likewise adapted .

E.1.4 Operations

Contrary to version 1.1, all predefined aspects are defined as operations and must therefore be written using brackets.



Object Constraint Language, The. Getting Your Models Ready for MDA
The Object Constraint Language: Getting Your Models Ready for MDA (2nd Edition)
ISBN: 0321179366
EAN: 2147483647
Year: 2003
Pages: 137

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net