Yes, I’m a declared OCL fanboy (plenty of my research work revolves around OCL) but I truly believe that time has come for you to learn OCL (Object Constraint Language).
Let me give you just two powerful reasons for that:
- OCL is everywhere. You can use it to define constraints on models (and derivation rules, and init expressions, and operation contracts, etc) but also to define the well-formedness rules of new DSLs you design and, most likely, you´ll need to define any kind of model manipulation operation (e.g. OCL is used to define the matching patterns for model-to-model and model-to-text transformations)
- Without OCL, all you have are either inaccurate specifications (if you just a graphical modeling language like UML, you won’t be able to express all the information required to convey the exact information of the domain in the diagram) or ambiguos ones (if, to complement the graphical model, you decide to use annotations in natural language).
For the later, let me reuse a cartoon (from Far Side ) that John Mylopoulos , in his keynote talk at the ER’09 conference , used to illustrate the misunderstandings that may occur when using informal modeling languages: there may be a huge difference between what we say and what others understand!!
A complete modeler needs OCL, UML (or any other graphical language) is only the tip of the iceberg when it comes to provide complete and precise specifications!!
And if you are now convinced and want to start learning OCL, check our brand new OCL tutorial
ICREA Research Professor at Internet Interdisciplinary Institute (UOC). Leader of the SOM Research Lab focusing on the broad area of systems and software engineering