Appendix E. Differences Between OCL Versions 1.1 and 2.0

The previous edition of this book, which appeared in 1999, described OCL version 1.1. This edition describes OCL version 2.0. This appendix lists the differences between both versions of the OCL standard.

Syntax Changes

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.

Enumerations and Class ...

Get Object Constraint Language, The: Getting Your Models Ready for MDA, Second Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.