Skip to main content

Notice: This Wiki is now read only and edits are no longer possible. Please see: for the plan.

Jump to: navigation, search



Articles and Presentations


Making OCL crash-proof.


Review of the sad OCL state of the art emphasizing the OMG-related aspects of the problems.

Review of the sad OCL state of the art emphasizing the OMG-related aspects of the problems.


Review of the OCL history and future prospects.

Review of 5 alternative visualizations of OCL.

Description of the Eclipse Pivot OCL Map Type.

2017-2018 / Photon, 2018-09, 2018-12

A lightning presentation on the limitations of support for type construction within OCL.

A simple solution to using any M2M for M2T; use a standard text metamodel and exploit EMF Resource flexibility to save the text model as plain text. Also provides a solution to XML2XMLwith any M2M tool. Suggests some M2T-friendly OCL extensions.

Models provide a disciplined representation of information. Model-to-Model (M2M) transformations convert between model structures. When a more readable representation is required, Model-to-Text (M2T) transformations convert a model structure to a concatenation of character sequences. We ignore the obvious conversion differences and demonstrate that an unmodified M2M tool can be used for M2T. We achieve this with a standard Text model that post-processes the M2M model output to yield formatted text.

The Collection iterations and operations are perhaps the most important part of OCL.

It is therefore important for an OCL evaluation tool to provide efficient support for Collections. Unfortunately, some clauses of the OCL specification appear to inhibit efficient or deterministic support. We review the inhibitions and demonstrate a new deterministic and lazy implementation that avoids them.

Lightning talk : OCL's 4-valued logic is a source of much unhappiness. We attempt to recreate the design decisions that led to the current design and thereby suggest solutions to escape from it.

2016-2017 / Oxygen

Lightning presentation explaining the importance of unnavigable opposites; particularly for the QVTc trace.

'Keynote' presentation on the slow progress towards OCL '2.5'.

2015-2016 / Neon

  • "OCL Roadmap", E.D.Willink, OMG quarterly meeting, December 2015

Consideration of alternative OCL 'next' specification approaches.

Eclipse OCL debugger promo.

Introduction to the OCLforUML profile, validation, collections, numeric stereotypes.

Problems and solutions for the introduction of ?. and ?-> operators to (Eclipse) OCL. "slides"

The forthcoming automation for the CS to AS conversion.

2014-2015 / Mars

Techniques used by Eclipse OCL to enable OCL to be used and debugged with a larger application. "slides"

State of the art report on plans for OCL 2.5.

2013-2014 / Luna

Lightning presentation on the Java code generator for Eclipse OCL.

Presentation on changes in OCL 2.4 and future plans. Also presented in part to OMG ADTF.

2012-2013 / Juno

Very brief presentation/demonstration of the new facilities in Juno; Code Generation and Complete OCL loading.

Brief comparison of OCL/Xbase roles. Overview of OCLinEcore and Complete OCL editors. Description of the primary features of the OCL VM; polymorphic values, fast operation dispatch and extensibility to QVT.

Presentation to the OMG Architecture and Design Domain Task Force on the current direction of work on OCL with particular emphasis on potentially controversial topics.

Brief overview of the code generator technology. "slides"

Joint OCL, EMF-IncQuery presentation on OCL Code Generator (fast), OCL VM (faster) and incremental query matching (super-fast).

2011-2012 / Indigo

Presentation to the UML Simplification Working Group on the current direction of work on OCL and on initial results from using Eclipse OCL tooling for the UML 2.5 constraints.

The utility of the Object Constraint Language for modeling within Eclipse has increased dramatically in the last few years, so that Eclipse OCL is now useful for everyday modelers rather than just advanced Java programmers.

This tutorial will demonstrate to existing EMF users how OCL in isolation can enhance their models and how the Eclipse support is re-used within advanced model transformation tools.

The tutorial will first introduce OMG's OCL language and its capabilities, then show how OCL can be embedded within Ecore to support validation and evaluation of dynamic EMF models without using genmodel at all. This part of the tutorial will introduce the OCLinEcore text editor that supports the combined development of OCL and Ecore, the CompleteOCL editor that supports complementary development of OCL and the the Interactive OCL Console that supports interactive evaluation.

Models developed during the Ecore integration part of the tutorial will be elaborated during the rest of the tutorial to demonstrate how model representations can be transformed using model to model transformations and then presented in human-friendly fashion by model to text transformations.

The model to model transformation section of the tutorial will provide a brief overview of OMG's QVT Operational Mappings language and Eclipse's M2M/QVTo tooling, while developing the running example with particular emphasis on the use of OCL to perform complex navigations and queries.

The model to text transformation section of the tutorial will provide similar brief overviews of OMG's M2T language and Eclipse's M2T/Acceleo tooling. The running example will be elaborated to showing more extensive use of OCL.

OCL supports the formulation of very compact queries that it is useful to practice. The tutorial will demonstrate this style of working by providing regular opportunities to configure and use some OCL facility with additional challenges for those participants who find the basic examples too easy.

OCL is widely used by UML and other languages to constrain metamodels and perform evaluations on models. Unfortunately no OCL 2.x specification has ever been aligned with any UML 2.x specification. This lack of alignment makes some OCL compliance points such as XMI interchange unachievable. This paper describes how introduction of an OCL Pivot Meta-Model and clear exposition of the Values package may provide a solution to the alignment and a variety of other specification issues.

OCL is widely used by UML and other languages to constrain metamodels and perform evaluations on models. The OCL specification is the result of diligent but time-constrained human endeavor and so contains many inconsistencies, most of which are relatively easy to ignore as obvious typographical mistakes. However the need to ignore minor discrepancies undermines rigorous treatment of more significant issues. The minor issues can be substantially eliminated by autogenerating the specification. This paper provides early community visibility of proposed solutions to a variety of issues that arose while developing a model for the OCL Standard Library that forms the core of the OCL specification.

2010-2011 / Helios

The utility of the Object Constraint Language for modeling within Eclipse has increased dramatically in the last few years, so that MDT/OCL is now useful for everyday modelers rather than just advanced Java programmers. This long talk is focused on both non-OCL users and advanced OCL users so that any kind of audience may learn how OCL can enhance your (meta-)model definitions and how OCL forms the foundation of advanced modeling technologies such as Acceleo and QVT.

In the first part of the talk, focused on modelers who have yet to discover OCL, you will get a short introduction to the OMG's OCL language and its main capabilities. Then you will learn how OCL can be embedded within Ecore to define constraints for validation, operation bodies for evaluation and derived features for initialization of EMF models (both dynamic instances and those from generated Java classes using "genmodel"). A presentation of the OCL Interactive Console will be used to help the user to alternatively write and validate their OCL constraints.

Finally, focusing on the advanced OCL audience, you will learn about ongoing work to exploit Xtext to provide an enhanced OCL development environment and of OCL to define its own editors and language semantics. Extensive use of OCL within OCL mandates a dramatic performance improvement requiring a flexible Java code generator for an efficient first evaluation of an OCL expression and an impact analysis to avoid redundant re-evaluation following a model change.

The current tooling used for the Eclipse OCL project uses an LALR parser generator. Enhancing the tooling to support editing motivated a migration to exploit the inherently model-driven characteristics of Xtext. This paper summarizes the experiences of that migration, identifies the many benefits and discusses a few changes in implementation approach that were required. Objective performance and size comparisons between the old LALR and new Xtext approach are provided.


The size of Unified Modeling Language (UML) models used in practice is very large and ranges up to hundreds and thousands of classes. Querying of these models is used to support their quality assessment by information filtering and aggregating. For both, human cognition and automated analysis, there is a need for fast querying. In this context performance of model queries becomes an important issue. We investigated performance characteristics of two different querying engines: one using the Object Constraint Language (OCL) and the other using Prolog. Our comparison is based on equivalent queries in both languages. We applied the queries to 118 models of a size up to 10000 classes to analyze model load and evaluation time. Our preliminary results show that if execution time of queries is linear then Prolog is faster. For one of the presented cases, the execution time in Prolog was nonlinear and thus higher. Further studies should focus on a performance analysis reflecting expressiveness aspects. Our experimental material is accessible to enable future replications of this study.


With the availability of infrastructural support for OCL (Object Constraint Language) provided by MDT OCL, the next step consists in simplifying the authoring of OCL speci�cations with feature-rich tools, as part of the more general task of model author- ing. The capabilities of the OCL Tools project are described (currently they comprise an OCL ! Java compiler and a text editor for OCL). A discussion of areas for im- provement and related work follows (refactoring of OCL expressions, detecting code smells, analyzing and optimizing OCL expressions). These ideas for future work fall under the umbrella of model compilers, essential elements of Model-Driven Software Engineering.

The Eclipse infrastructure for modeling is based on EMF, with support for OCL 2.0 provided by the Model Development Tools (MDT) project. The combined expressive power of Ecore + OCL allows capturing a sizable amount of development requirements in a declarative manner: (a) data modeling aspects can be expressed as an Ecore-based schema further constrained by OCL invariants; (b) a number of functional requirements can be specified as operation pre- and postconditions, together with side-effects-free queries. The OCL compiler reported in this paper extends the code generation process of EMF by performing a translation from OCL types and expressions into Java types and statements, increasing productivity and quality measures of a Model-Driven Software Development (MDSD) process. The generated code can be directly used as the Model component in an MVC architecture (for example, as part of a graphical editor generated with Eclipse GMF).

The Model Development Tools Object Constraint Language (MDT OCL) project provides the building blocks for Model-Driven tools to weave OCL declarative specifications into software artifacts. We showcase some of these possibilities, taking as starting point a plug-in to visualize OCL abstract syntax trees (ASTs) in the form of annotated trees. This example motivates some practical tips about patterns for OCL visitors, including using Java 5 generics and achieving conciseness by letting MDT OCL take care of the "walking" order. To really reap the benefits of OCL-enriched specifications, tools in our modeling chain have to be able to transform such expressions into the target software platform (e.g. compile into Java, translate into SQL). Work in this area is summarized, to ease jump-starting your own OCL processing project.

This article illustrates how the MDT OCL parser/interpreter technology adds to the value of EMF/JET code generation as a foundation for model-driven development (MDD). We will see, with fully functional examples, how a model can be generated from an Ecore specification without requiring any post-generation custom code, including complete implementations of:

    • invariant constraints
    • derived attributes and references
    • operations

Back to the top