Metamodel Engine is delivered in the form of a library (me-lib.dll) providing
the functionalities we will now describe.
Importation of the UML model
In order to recover the UML model, ME uses the XMI standard format, defined by
the OMG, because this format is now supported by a majority of UML editors.
Versions 1.0 and 1.1 are supported by ME for the moment.
The software producing of compatible files XMI are listed
The model imported by ME is represented in memory by elements of the ME
metamodel. An element could be a package, a class, a method, an association, a
generalization, or any other element of a UML model. Each element can contain
tags, which will make possible to attach informations to the elements. These
tags, for example, are used to attach documentation (with the JavaDoc format
for example) with an element of the model. We will see thereafter that these
tags are also used to attach ME information to an element.
These elements could be traversed by using the design pattern visitor. We will
see in detail the concepts of visitor
To generate code, ME uses "maps". A map is in fact a library (DLL) or a XME file
(xme) which implements a visitor. Thus, the visitor implemented in the map will
be able to traverse the elements of the metamodel and to progressively generate
the associated code.
The interest of this system is to make it possible to the user to personalize
the generated code, but also to develop new maps by using the C# language
available in the .NET framework, or by using the ME map format, namely the XME,
which is a XML file.
In fact, a map is a plug-in which will be loaded dynamically by ME. Thus, ME is
more easily integrable with other tools.
The maps are detailed here
and also here
To recover the UML model from the code, ME uses regular expressions which will
enable us to identify the structure of the packages, the classes, the methods
and the attributes.
Any text being found between the elements identified by the regular expressions
is attached, thanks to the tags, to the element at side of which it was found.
Thus, if it finds the following Java code:
public whole String method(int)/* comment */
/* comment */ will be attached at the end of the method declaration, and return
will be attached to the block corresponding to the body of the method.
return "Hello world!";
A tutorial can be found here,
but this is a little complex so be sure to be ready.
Generation of UML model
To generate UML model, ME also uses the XMI. It could thus be imported in a tool
of UML modeling, be modified, and re-exported towards ME.
To generate the model into XMI, ME derives its functionnment from the "standard
one": ME uses a map quite simply implementing the generation into XMI instead
That shows that ME can be used for all the transformations of the XMI and not
only to generate code, even if that remains the main goal. One could for
example import diagrams of use cases to transform them into images via the
appropiated library of the .NET framework. Description
The project team is composed of