Model Transformations are essential
Some recent Twitter discussions triggered by the interview of Steven Kelly by Angelo Hulshout are interesting:
Rafael Chaves supports the idea that “the only model transformation that really matters is from original model into code”:
I do not agree with this idea. In classical MDE we usually distinguish three different kinds of transformations:
- Code to Model
- Model to Model
- Model to Code
The most popular transformation is of type 3. This is sometimes called Model2Text or MOF2Text and typically allows to generate Java code from UML models. More generally these kinds of transformations have been heavily used in MDD for software artefact generation from abstract models. The source model conforms to a given metamodel (like the UML metamodel) and the target text conforms to a given grammar (like the Java grammar). There is an Eclipse M2T project.
But transformations of type 2 called M2M are central. The Eclipse M2M project proposes for example QVT and ATL but there are plenty of other possibilities. There are many examples of such transformations, for example in the ATL transformation zoo. In these M2M transformations, there is usually at least one source metamodel and one target metamodel, usually different.
The less known transformations are of type 1 sometimes called Text2Model. They are usually used in reverse engineering of legacy code in projects like the Eclipse MoDisco project. One example is the extraction of Java models from Java code. In MoDisco there is an open source Java metamodel of excellent quality that is quite close to the Java grammar. But one could imagine also directly extracting for example business rules from a Java program by using a Business rule metamodel. Alternatively another solution would be to use a Java.code to Java.model C2M transformation, and then a Java.model to BusinessRule.model M2M transformation. Usually C2M transformations are more expansive to develop than M2M transformations.
So I believe that all three categories of transformations are equally important. M2C and C2M transformations involve one metamodel and a grammar while M2M transformations involve two metamodels.
Similarly to M2C and C2M transformations, we could also have M2X and X2M transformations where grammars would be replaced by XML schemas. Following the same idea, we could also envision M2DB and DB2M transformations where grammars would be replaced by Data Base schemas. All these native transformations would be quite useful, since they could be used with common M2M transformations.