has arise from the necessity of bridging an expressivity gap of UML (diagrams are unable to capture most of the constraints imposed by nontrivial software systems)
final target is to produce high quality software by using models
OCL is not a standalone language, but a language meant to complement UML
is a typed language – all elements of OCL expressions are typed ⇒ the type of any OCL expression can be obtained by inference
supports
first order logic
main features of OOP
OCL specifications are inherited in descendants, where they may be overwritten
constraint redefinition complies with the rules established in Design By Contract
the language supports type-casting, including upper type-casting
purpose to support:
model navigation - querying the information in a model through (repeated) navigation of its association relationships using role names
specification of assertions - explicit definition of pre/post-conditions and invariants, as promoted by Design by Contract
definitions of behavior - body specifications for the query operations included in the model, derivation rules for existing attributes and references, as well as the definition of new operations and attributes for the model
specification of guards, of type invariants for stereotypes
Predefined types
Basic Types: Boolean, Integer, Real, and String
Collections Types: Collection, Set, Bag, OrderedSet, and Sequence