



Here is a flash demo being a recap of these features :





Cédric already announced it two weeks ago: MPatch is integrated into EMF Compare!
Did you ever want to transfer changes from one model to another?
Or do you frequently perform the same changes on your models?
MPatch is a technology that stores model changes as self-contained artifacts, just like patches, that are also applicable to other models! Let me show an example of how MPatch works:
This is just a simple model, a base version on the left and a modified version on the right.
Modeled with the IBM Rational Software Architect, but any kind of EMF model is supported.
The changes are highlighted: 3 deleted attributes, 1 updated attribute, 1 new class, 3 new generalizations.

EMF Compare is a nice tool for calculating such changes. The result is shown below.
All changes are nicely highlighted in the treeviews and one can browse through them.
This is where MPatch comes into play: the export menu lists a new option!

An export wizard is started that guides the user through the MPatch creation task.
In the end, the changes are stored in a file, extract_id.mpatch for example.
This file can now be applied to other models, even if their contents differ!

The model below is a different one -- again we want to extract the id attribute into a common superclass.
However, the attributes, the classes, and even the number of attributes and classes differ!

Let's see how MPatch handles the situation.
Selecting Apply MPatch triggers a wizard with the same name.
The crucial part is the so-called resolution of symbolic references -- they are responsible for selecting the proper model elements of your target model.
Let's have a closer look:

Following the wizard to its end updates the given model and this is the result:

To wrap up, an Mpatch is not only a self-contained patch for models, it is even able to make the changes applicable to different models!
Installation instructions and a lot more information on the project website: http://modeldiff.imm.dtu.dk.

Then call it from your template, obviously it's not going to work as is. Here we're calling the "getJavaCompatibleName" method on an EClass, but this method is not existing on this type. Acceleo provides a mechanism to call Java logic associated with a given meta-class: the first parameter of the method have to be of the type of the extended meta-class and Acceleo will automatically transform a myInstance.myMethod() call to a SomeClass.myMethod(myInstance).