The Object Constraint Language: Getting Your Models Ready for MDA (2nd Edition)

In Section 1.2.3, you learned the building blocks of the MDA framework: models, languages, transformation definitions, and transformation tools. As shown in Figure 5-1, OCL is very helpful in creating at least three of the building blocks:

  • Models, because only with a precise specification language can models be built on maturity level 4

  • Transformation definitions, because a formal and precise language is needed to write transformation definitions that can be used by automated tools

  • Languages, because languages need to be understood within the MDA framework. This is only possible if the language definition is formal and precise.

Figure 5-1. Use of OCL in the MDA framework

How to build better models using OCL has been the subject of this book so far. In this chapter, we focus on the second and third aspect of these building blocks: the definition of transformations and modeling languages. For this, we must get to know the metalevel of modeling. This chapter introduces metamodels and metamodeling; explains the UML and OCL metamodels; shows how OCL has helped in the development of these metamodels; and provides an example of a transformation definition written in OCL.

Категории