• A transformation tool takes a PIM and transforms it into a PSM.• A second (or the same) transformation tool transforms the PSM to code.• We have shown the transformation tool as a black box. It takes one model as input and produces a second model as its output.
• When we open up the transformation tool and take a look inside, we can see what elements are involved in performing the transformation.• Somewhere inside the tool there is a definition that describes how a model should be transformed.
• For example, define a transformation definition from UML to C#, which describes which C# should be generated for a (or any!) UML model.• Transformation definition consists of a collection of transformation rules (unambiguous).• We can now define transformation, transformation rule, and transformation definition.
• A transformation is the automatic generation of a target model from a source model, according to a transformation definition.• A transformation definition is a set of transformation rules that together describe how a model in the source language can be transformed into a model in the target language.• A transformation rule is a description of how one or more constructs in the source language can be transformed into one or more constructs in the target language.
METAMODELINGIntroduction to Metamodeling Models, languages, metamodels, and metalanguages• We defined a model as a description of (part of) a system written in a well-defined language.• How do we define such a well- defined language?
• Languages were often defined • However, BNF restricts us to using a grammar in BNF. languages that are purely text• For example, have a graphical based. syntax, like UML. • We will need a different mechanism for defining languages in the MDA context. • This mechanism is called metamodeling.
Models, languages, metamodels, and metalanguages• A model defines what elements can exist in a system.• The model of the language describes the elements that can be used in the language.
• Because a metamodel is also a model, a metamodel itself must be written in a well-defined language.• This language is called a metalanguage.• First, a metalanguage plays a different role than a modeling language in the MDA framework, because it is a specialized language to describe modeling languages.• Secondly, the metamodel completely defines the language.
The Use of Metamodeling in the MDA• First, we need a mechanism to define modeling languages, such that they are unambiguously defined, a transformation tool can then read, write, and understand the models. Within MDA we define languages through metamodels.• Secondly, the transformation rules that constitute a transformation definition describe how a model in a source language can be transformed into a model in a target language. These rules use the metamodels of the source and target languages to define the transformations.