OCL statement | can be used for automatic code generation | ![2001-08-30 14:56:50.0](facet.gif) |
can consist of - References to role names, association names, attributes and the results of operations.
- The logical values true and false
- Logical operators such as and, or, =, >, < or <> (not equals)
- String values such as: 'a string'
- Integers and real numbers (the latter having a decimal point)
- Arithmetic operations *, /, +, -
| ![2001-08-30 14:56:50.0](facet.gif) |
can navigate from class to class using a dot to separate components. For example, in LinearShape, to refer to the length of the edges you can refer to edge.length. | ![2001-08-30 14:56:50.0](facet.gif) |
can refer to all the values in a collection using the forall operator | ![2001-08-30 14:56:50.0](facet.gif) |
can refer to special OCL properties of a collection itself using the -> operator | ![2001-08-30 14:56:50.0](facet.gif) |
can use the {ordered} constraint to indicate that an OCL collection is a sequence, which allows you refer to special properties such as first and last | ![2001-08-30 14:56:50.0](facet.gif) |
can use the implies operator which is true if either the left hand side is false or if both sizes are true | ![2001-08-30 14:56:50.0](facet.gif) |
does not have to be written on a UML diagram but can be written separately with a context specified | ![2001-08-30 14:56:50.0](facet.gif) |
has example {startPoint <> endPoint} constrains the two ends of a LineSegment to be different | ![2001-08-30 14:56:50.0](facet.gif) |
is a subtopic of 5.6 - More Advanced Features of Class Diagrams | ![2001-08-30 14:56:50.0](facet.gif) |
is not compiled | ![2001-08-30 14:56:50.0](facet.gif) |
is not executed | ![2001-08-30 14:56:50.0](facet.gif) |
is a kind of statement | ![2001-08-30 14:56:50.0](facet.gif) |
specifies a logical fact (a constraint) about the system that must remain true | ![2001-08-30 14:56:50.0](facet.gif) |
statement | should be not more than one line long if possible | ![2001-08-30 14:57:47.0](facet.gif) |