metaDepth – A new framework for multi-level meta-modelling

Tweet about this on TwitterShare on FacebookBuffer this pageShare on RedditShare on LinkedInShare on Google+Email this to someone

Esther Guerra and Juan de Lara  introduced me to their latest tool: metaDepth a new framework for multi-level meta-modelling.

The main feature of metaDepth is its support for an arbitrary number of ontological meta-levels. This makes MetaDepth especially useful to define multi-level languages. That is, instead of adhering to the typical 3-layer metamodeling architecture (model/metamodel/metametamodel), designers can define any number of metamodeling levels. This is especially useful when designing languages spawning multiple meta-levels.

As they explain in the tool web page , a good example is the relationship between objects and classes in the UML. One can think of object diagrams to be instances of class diagrams. Hence class+objects diagrams can be considered a multi-level language, and can be defined in MetaDepth through a unique meta-model. Compared with the cumbersome solution provided in the UML standard (where objects are defined at the same meta-level as the classes they are supposed to instantiate, using the non-intuitive InstanceSpecification, Slot, InstanceValue,… metaclasses), this has the advantage of a simpler definition, and that the system’s infrastructure takes care of the instantiation relations between objects and classes.

This kind of relationship appears in many other domains like web engineering (page node types/page instances), role control access (role types/roles), and many more. To me, another useful scenario in which to apply metaDepth is to clarify the relationship between classes, metaclasses and profiles, in particular stereotypes. Stereotypes crossover two meta-levels and this is very difficult to express with a fixed layered metamodel.

As a very simple example, we could define a class diagram composed by class nodes with a potency of 2, meaning that the metaclass Class supports two levels of instantiations (the first one would correspond to the classes of the model and the second one would allow us to represent the instances of those model classes, i.e. the objects in the system).

strict Model [email protected]{
  ext Node Class{ 
    [email protected]  : boolean = FALSE;
    [email protected]	      : Class[*];
    [email protected]	      : Class[*];
    [email protected]: $self.isAbstract=FALSE$
  Edge Association(Class.out, Class.IN) {}

Then, with this simple metamodel, we can define our own class diagram:

ClassDiagram Example{
  Class Person {
    NAME : String;
    age  : INT;
    neighbourS : Person[*] {out};
    neighbourT : Person[*] {IN};
    subordinate: Employee[*] {out};
  Class Employee : Person {
    boss : Person[1..*] {IN};
  Association neighbour (Person.neighbourS, Person.neighbourT){
    isFriendOf : boolean = FALSE;
  Association isBossOf (Person.subordinate, Employee.boss);

and at the same time our object model

Example Exx {
  Person Juan{ NAME = "juan"; age = 36; }
  Employee Sacarino{ NAME = "Sacarino"; age = 22; }

Btw, as you can see, metaDepth use a textual syntax  to define the (meta)models, which many of you would consider an additional benefit.


Tweet about this on TwitterShare on FacebookBuffer this pageShare on RedditShare on LinkedInShare on Google+Email this to someone


Your email address will not be published. Required fields are marked *