A model transformation is a model-to-model mapping. The transformation term is directly related to the terms model and metamodel, and its understanding is required in the context of Model Driven Software Development (MDSD). Model transformation transforms platform-independent models into platform-dependent models as well as program code
. Transformation rules describe how elements of the source model are transformed into a target model. A transformation rule forUnified Modelling Language(UML) models, for example, is typically formulated at the UML metamodel level and often uses UML profiles - the mechanism for extending UML. Distinctions exist for transformations in terms of source and target models - endogenous and exogenous transformations are distinguished. In addition, horizontal and vertical transformations are differentiated depending on the abstraction levels. In the context of MDSD, characteristics
have emerged to distinguish transformations with respect to their implementation. Transformation methods are distinguished between model-to-text transformations and model-to-model transformations. Transformation systems support specific transformation methods
Knowntransformationsystems Known transformation systems include
the ATLAS Transformation Language (ATL), the IBM Model Transformation Framework
(MTF), theJava Emitter Templates (JET), transformations with the ARIS Business Architect, and XLST. With Query View Transformation (QVT), a budding standard for describing model transformations has existed for some time. Other transformation languages include UMLX - a graphical language
for specifying transformations to UML object models - as well as languages for so-called graph transformation such as TIGER (TU Berlin) and VIATRA2 (University of Budapest). In general, atransformation refers to a reshaping or reshaping
In the context of MDSD, a model transformation is defined as the automated transition from a source model to a target model depending on a so-called transformation definition - which is a set of transformation rules. Thus, a transformation rule represents a description of how one or more elements of the source model are transformed into one or more elements of the target model. Rules always consist of a right and left part. Parts of the rule that refer to the source model are also called Left-Hand-Side (LHS) - analogously
, parts that refer to thetarget model are called Right-Hand-Side (RHS).
The concepts and their relationships in a language are generally defined by its
abstractsyntax - this is also true in the context of specific modeling languages. Based on this abstraction, a distinction is also made with respect to endogenous or exogenous transformations. In the case of an endogenous transformation between models, their abstract syntax of the modeling languages is the same in each case. Examples of endogenous transformations are optimizations, simplifications, or normalizations of source models. Consequently, in the case of an exogenous transformation, the syntaxes of the model transformations under consideration are explicitly different, which leads to the fact that the exogenous transformation is also called translation. Synthesis, reverse engineering or migration
are classical exogenous transformations
The vertical and horizontal transformationFurthermore, one distinguishes horizontal and vertical transformations. This definition is based on the idea that models can represent the underlying originals at different levels of abstraction. If the source and target models are on the same level of abstraction, this is called a horizontal transformation. An example is the migration of software, where models of a source language are transferred to a target language considering the same aspects
. In contrast, when the source and target models are not at the same level of abstraction, this is referred to as vertical transformation. If, for example, the source language is at a higher level of abstraction than the target language, a vertical transformation is assumed - this is also referred to as refinement. Thetransformation of a specification into executable program code is such a refinement.
Transformations can be implemented in different ways. In this respect, different characteristics have emerged in the context of MDSD, which ultimately also form the basis for different languages for model transformation. With regard to their implementation, transformations are distinguished on the basis of the following characteristics:
- The transformation rules, which can be unidirectional or bidirectional. Unidirectional means mapping from source model to target model, in contrast, bidirectional rule specifies in mapping in both directions.
- In rule scheduling, multiple rules must be applied for transformation.
- In localization, a rule is applied only to a specific part of the source model.
- The direction of transformations - unidirectional and bidirectional transformations are again distinguished. This aspect must be taken into account when synchronizing models.
- The organization of rules, which can be divided into modules depending on certain criteria.
- Model-to-text transformations
- Model-to-Model Transformations
is generated, which, however, is not checked for the underlying metamodel in the process. This is different with a model transformation; here the conformity of the model to the metamodel is checked during execution. Transformation methods are distinguished as follows:Visitor method. This approach implements a so-called Visitor mechanism. This then enables the model representation - for example UML - to be traversed and the code to be generated from it as a text stream. A well-known project
in this context is Jamda. Itrepresents UML models by Java classes and implements a code writer that traverses the models and generates the code from them.
Templates are the basis of the generation. These are in text format and consist of two parts. One part provides access to the source model, while the second part consists of text and expressions that allow modification of the text depending on the source model.
Direct Manipulation. An API
is provided to specifically access the model representation. An object-oriented framework implements this application programming interface (API)Structure Driven. First, the hierarchical structure of the target model is created. In a second step this model is then extended with attributes
and references to the various model elementsOperational extends the approach of Direct Manipulation in the form that additional information
is availablefor a transformation. In the simplest case this can be realized for example by extending a language such as OCL
. Here the template again consists of fragments of a model, so that when the target model is created, a check is made to ensure that it conforms to the metamodelRelational Here the relationships between model elements are expressed by the mathematical concept of relations
Graph Transformation. Models are represented by graphs, which in turn are generated by corresponding graphical notations
. Specific graph transformation rules are defined for the transformation.Here only the main transformation methods have been mentioned, besides there are other hybrid approaches that combine the different transformation methods and techniques.
that support transformation methods and techniques are called transformation systems.
Awide range of transformation systems exists. Examples in this respect are:
- ATLAS Transformation Language (ATL), a language for describing transformation definitions,
- Java Emitter Templates (JET), part of the Eclipse Modeling Framework (EMF), text artifacts are generated by applying templates,
- IBM Model Transformation Framework, prototype transformation system for relational transformation methods,
- Extensible Stylesheet Language Transformation (XSLT), transformation rules are described using templates,
- Query View Transformation (QVT), imperative language for describing model transformations,
- UMLX, graphical language for specifying transformation based on UML object models.