
h3(#OverallOptions). Overall Options

The two overall options are independent of the Ecore/UML/Pivot bindings.

h4(#DefaultDelegationMode). Default Delegation Mode

The Eclipse OCL project provides two execution engines which may be used to support EMF Delegates.

!{width:70%}images/1810-default-delegation-mode.png(Default Delegation Mode)!

h5(#LPGDelegation). http://www.eclipse.org/emf/2002/Ecore/OCL/LPG

EMF Delegate annotations referencing the @http://www.eclipse.org/emf/2002/Ecore/OCL/LPG@ URI are serviced by the classic evaluator that uses the LPG parser.

This URI was introduced in the Indigo release.

h5(#PivotDelegation). http://www.eclipse.org/emf/2002/Ecore/OCL/Pivot

EMF Delegate annotations referencing the @http://www.eclipse.org/emf/2002/Ecore/OCL/Pivot@ URI are serviced by the new experimental evaluator that uses the UML-aligned Pivot model.

This URI was introduced in the Indigo release and was imposed by the Indigo OCLinEcore editor.

h5(#DefaultDelegation). http://www.eclipse.org/emf/2002/Ecore/OCL

EMF Delegate annotations referencing the @http://www.eclipse.org/emf/2002/Ecore/OCL@ URI are serviced by the evaluator selected on the preference page by the "Default Delegation Mode":#DefaultDelegationMode.

This URI was introduced in the Helios release and was imposed by the Helios OCLinEcore editor.

Use of an Indigo or Juno editor converts the URI to use the Pivot evaluator.

In Kepler, a prevailing URI in the input file is preserved, unless changed by the context menu setting. If no prevailing URI exists a default is determined by an OCLinEcore preference setting that defaults to the Pivot evaluator.

h4(#CodeGenerationMode). Code Generation Mode

Juno introduced an experimental ability to replace the delegated interpreted execution of OCL by direct execution of compiled Java code. This facility has been substantially improved and tested for the Kepler release.

Optimisations for Luna included inlining the bodies directly into the EMF Impl classes. 

Mars has useful fixes and benefits fronm safe naigation analyses.

Further optimisations are scheduled for Neon.

!{width:70%}images/1810-code-generation-mode.png(Code Generation Mode)!

This option may be selected to change the realization of OCL option.

h5(#CodeGenerationMode-DELEGATED). Delegate for interpretation at run-time

Selecting the default delegation mode retains the Helios and Indigo functionality whereby *genmodel* generates Java code that encodes the OCL expressions as text strings. Each expression is lazily compiled at run-time with the result being cached to reduce overheads for repeated execution.

h5(#CodeGenerationMode-GENERATED). Generate Java code in xxxBodies classes

Selecting Java code generation causes *genmodel* to run Xtend templates that generate
* a _Package_ Tables.java file
* inline OCL implementations within the _Class_ Impl.java files

The tables file contains an optimised model representation allowing polymorphic operations to be dispatched in constant time.

The implementation files contain Java code corresponding to each OCL expression defining operation bodies or property initializers.

Disclaimer: the generated code is experimental has yet to be optimized and so is only about five times faster than the interpreted execution. 
