3.2. Structure package

[Warning]Text not verified for kermeta 2

Structure package

Figure 3.2. Structure package


This figure presents the main classes of the structure package. To design this package, we started from EMOF and completed it to build the Kermeta language. The choice of EMOF is motivated by two main reasons : firstly it is standardized by the OMG and secondly is is well-supported by tools such as Eclipse/EMF.

As MOF is not initially designed to be executable, several concepts have to be completed and slightly modified to build an executable language. The first and most important modification is to add the ability to define the behavior of operations. To achieve this we define an action language in the package behavior of Kermeta. The class hierarchy of the package behavior is presented on ??? . In practice, Kermeta expressions have been designed by adding model modification capabilities (like assignment of properties for instance) to OCL expressions.

This represents the static part of the metamodel.

As a reminder, the structure of Kermeta is derived from EMOF from the OMG. During the build process, we merge and connect it with the behavior part.

So all the meaning of those metaclasses are very close to those described in the OMG standard specification.

3.2.1. NamedElement view

NamedElement class diagram

Figure 3.3. NamedElement class diagram


This figure presents the element in the structure package that have a name. Kermeta relies on in various situation (For example in the typechecking process). The containment hierarchy is also presented since it is used in the identification process.

Class is a bit special, since its name is a derived property.

3.2.2. Type system view

Kermeta type system class diagram (the big picture)

Figure 3.4. Kermeta type system class diagram (the big picture)


This figure presents the global view of all the metaclasses involved in Kermeta type system.

Basically, you can notice the split between Type and TypeDefinion needed in order to handle generics.

The containment is also represented here.

Please note that there is both Type and TypeDefinition . This is needed because of the support of the generics. For example in

var mycoll : Collection<String>

mycoll is a VariableDecl which point to a Class whose typeDefinition is the ClassDefinition Collection and has a TypeVariableBinding that lead to String.

TODO add an object diagram or a figure to illustrate.

TODO : if time : provide a set of small diagrams that focus of some elements of the type system.

3.2.2.1. ModelType and ModelType adaptation view

Kermeta ModelType system class diagram

Figure 3.5. Kermeta ModelType system class diagram


This figure presents the global view of the main metaclasses involved in Kermeta ModelType.

Kermeta ModelType adaptation class diagram

Figure 3.6. Kermeta ModelType adaptation class diagram


This figure presents the view of the main metaclasses used by the ModelType adaptation.