Virtual EMF – Transparent Composition, Weaving and Linking of Models
When using the Eclipse Modeling Framework (EMF), one frequently faces the problem of having to deal with several large heterogeneous and interrelated models. The information relevant for a specific user at a given time is often scattered across those models. Therefore, we often have the need for composing, weaving or simply linking (parts of) these models in order to provide a more unified and usable view of the modeled system(s).
With the currently available technologies, this is not a trivial task. Ideally, we would like to have a kind of virtual EMF resource offering a centralized and transparent access point to a global view on these different interconnected models. It should be implemented in a way such that:
- The virtual EMF resource behaves as a normal model, so interoperability (compatibility with existing EMF-based solutions/tools) is guaranteed;
- There is a perfect synchronization between the composed view (virtual resource) and the original models;
- Performance is not an issue, because neither creating nor accessing the global view results in additional costs (loading time, memory usage, etc.).
As a solution, this talk introduces the brand new Virtual EMF tool which enables users to efficiently access, handle and combine a set of interrelated EMF models in a completely transparent way.
To actually illustrate the interesting capabilities provided by this EMF-based tool, we will demonstrate how this new approach is applicable to the very common problem of traceability between different models. The concrete scenario to be shown is a reverse engineering process in which several consecutive models obtained from the same Eclipse plugins source code have to be considered and treated all together.
Using the MDT MoDisco project, you can directly get a full representation of your Java source code as EMF models. The obtained Java models, covering everything from the package’s structure to the detailed content of the methods, can be practically used for many different purposes. Still using MoDisco and related Eclipse Modeling technologies (e.g. ATL), these models can be transformed into several different views. For instance, three of them would be:
- A KDM model to extract the superstructure of the source code;
- A UML2 class model to show its internal object-oriented architecture;
- The Java model itself.
Most likely, we would like to see the traceability relationships between these different models (e.g. while looking at the UML model, we may be interested in seeing which Java model excerpt corresponds to that specific UML element). This is particularly important when the different models may be updated during the reverse engineering process, and so may have to be synchronized accordingly.
We will use Virtual EMF, in this context, to implement the support for dealing transparently with all these models considering their traceability relations.