For a quick demonstration of OCL enrichment of an Ecore meta-model with computed constraints go to Getting Started.
A PDF version of this documentation is available at OCL 2023-12 (6.19.0) Documentation.
EMF is Modeled Structure
The Eclipse Modeling Framework ( EMF) supports the definition of structural meta-models and the subsequent use of models conforming to these meta-models. EMF also supports generating of Java code to represent the meta-models. Additional Java code can be provided to add behavior to the structural meta-models.
OCL is EMF and Modeled Behavior
OCL provides a modeling language that allows the behavior to be embedded within the structural meta-models or provided as a complement to those meta-models. As a modeling language, OCL understands the models and so OCL code is much more compact than the equivalent Java. OCL code can be statically checked, whereas the corresponding Java code often uses reflection and so cannot be checked.
Eclipse OCL is an implementation of the OMG OCL 2.4 specification for use with Ecore and UML meta-models.