Model Transformation by Commands
Model Transformation by Commands
Pablo Tomas Borda
Pablote.20@gmail.com
Abstract
Editing model transformations is actually a hard task. There are still not ways to edit transformations without knowing the source and target meta-models. This is a job about that.
We provide a new point of view on models to abstract the model transformation engineer from meta-models. There are actually different techniques around for model transformations like, by example, or using graphs, or just by code, like QVT. The problem is that none of this techniques, abstract model transformation engineers from source and target meta-models. So editing
transformations is actually a difficult task. In this paper we present a new paradigm to make model transformation an easy job, so that any person being or not a programmer are able to edit their transformations so easy, that they do not need to know meta-models existed.
We provide a new point of view on models to abstract the model transformation engineer from meta-models. There are actually different techniques around for model transformations like, by example, or using graphs, or just by code, like QVT. The problem is that none of this techniques, abstract model transformation engineers from source and target meta-models. So editing
transformations is actually a difficult task. In this paper we present a new paradigm to make model transformation an easy job, so that any person being or not a programmer are able to edit their transformations so easy, that they do not need to know meta-models existed.
Let’s suppose the following example:
Our today’s point of view says that we have a class ShoppingCart, a class Items, and there is a one to many relationship between them. The editor stores this sample model in that composite structure.
These three commands were executed by editor A when user clicked on the corresponding buttons. Thus, if we stored these sequential commands in a file in place of the model composite structure, when we open this model again, the editor is able to rebuild the model, sequentially running the stored commands, like in a log.
Now let’s suppose another example with a database diagram editor:
Fig 2. Sample Database Diagram
Editor
Editor
The corresponding database editor’s commands to create the sample model may be:
How do we think about transformations?
Think about the last two sample model editors, their diagrams are very similar, so we can derive from the UML diagram to the Database diagram by just establishing a correspondence between commands and not talking with difficult to understand meta-models.
Our transformation becomes a simple to understand correspondence between sequential commands and not difficult to understand meta-model elements. Let’s suppose we have the first UML sample diagram and we want to get the Database diagram. We open the transformation, that is a set of correspondences between commands and when ran with the UML diagram as input, generates the editor commands to build the Database diagram. To be able to generate this we may edit correspondences between commands as following:
Fig 4. This is a sample definitioin of a transformation rulo of a UML Class into an Entity from a Database diagram.
When user opens the transformation editor, selects from both input and output meta-model toolbars the commands they want to represent in the output meta-model's editor. The editor brings them up and allows user to click on one or more buttons from source, one or more buttons from target, drag and drop and perform operations on attributes, in order to define a transformation rule. When user considers transformation rule is done, adds it to the set of transformation rules that make up a single transformation
In that way we edit transformations without seeing anything of the meta-model.
Models and Transformation Meta/Models
What we get for free
We get the reverse transformation! For free! If we have a database diagram we can easily get back the UML diagram by just using the same transformation backwards.