-
Notifications
You must be signed in to change notification settings - Fork 0
kermeta
The following text is just a small compilation of relevant parts literally copied from [Model Driven Language Engineering with Kermeta] (http://www.irisa.fr/triskell/publis/2010/Jezequel10b.pdf).
Kermeta, a Kernel Meta-Modeling language and environment, is an EMF extension whose goal is to complement Eclipse off-the-shelf tools to obtain a complete environment for such DSMLs, including interpreters, compilers, pretty-printers and customizable editors.
Kermeta has been designed to easily extend meta-models with many different concerns (such as static semantics, dynamic semantics, model transformations, connection to concrete syntax, etc.) expressed in heterogeneous languages. A meta-language such as the Meta Object Facility (MOF) standard [18] indeed already supports an object-oriented definition of meta-models in terms of pack- ages, classes, properties and operation signatures, as well as model-specific con- structions such as containments and associations between classes. MOF does not include however concepts for the definition of constraints or operational seman- tics (operations in MOF do jot contain bodies). Kermeta can thus be seen as an extension of MOF with an imperative action language for specifying constraints and operation bodies at the meta-model level. To do that, Kermeta uses aspects. The idea is that the extended version of EMOF meta-model, referred to as Executable EMOF, would correspond to a new M3-Level meta-model defining a modeling language that could be used to specify meta-models containing meta-data and meta-operations.
The action language of Kermeta is especially designed to process models. It is imperative and includes classical control structures such as blocks, conditional and loops. Since theMOF specifies object-oriented structures (classes, properties and operations),Kermeta implements traditional object-orientedmechanisms for multiple inheritance and behavior redefinition with a late binding semantics (to avoid multiple inheritance conflicts a simple behaviors selection mechanism is available in Kermeta). Like most modern object-oriented languages, Kermeta is statically typed, with generics and also provides reflection and an exception handling mechanism.
The standard framework of Kermeta also includes all the operations defined in the OCL standard frame- work. This alignment between Kermeta and OCL allows OCL constraints to be directly imported and evaluated in Kermeta.
Since Kermeta is an extension of MOF, a MOF meta-model can conversely be seen as a valid Kermeta program that just declares packages, classes and so on but does nothing. Kermeta can then be used to breath life into this meta-model by incrementally introducing aspects for handling concerns of static semantics, dynamic semantics, or model transformations.
One of the key features of Kermeta is the static composition operator "require", which allows extending an existing meta-model with new elements such as properties, operations, constraints or classes. This operator allows defining these various aspects in separate units and integrating them automatically into the meta-model. The composition is done statically and the composed model is typed-checked to ensure the safe integration of all units. This mechanism makes it easy to reuse existingmeta-models or to split meta-models into reusable pieces. It can be compared to the open class paradigm.
Consequently a meta-class that identifies a domain concept can be extended without editing the meta- model directly. Open classes in Kermeta are used to organize "cross-cutting" concerns separately from the meta-model to which they belong, a key feature of aspect-oriented programming. With this mechanism, Kermeta can support the addition of new meta-class, new subclasses, new methods, new properties, new contracts to existing meta-model. The require mechanism also provides flex- ibility. For example, several operational semantics could be defined in separate units for a single meta-model and then alternatively composed depending on particular needs.
A meta-model can be seen as the def- inition of the set of allowed configurations for a set of objects representing a domain. All structures are represented as classes, relations and structural prop- erties. In MDLE, a meta-model defines a set of valid programs. However, some constraints (formulas to the logician, Boolean expressions to the programmer) cannot directly be expressed using EMOF. For example there is no easy way to express that formal parameter names should be unique in a given procedure declaration, or that in a valid Logo program the number of actual arguments in a procedure call should be the same as the number of formal arguments in the declaration. This kind of constraints forms part of what is often called the static semantics of the language.
In Model-Driven Engineering, the Object Constraint Language (OCL) is often used to provide a simple first order logic for the expression of the static semantics of a meta-model. OCL is a declarative language initially developed at IBM for describing constraints on UML models. It is a simple text language that provides constraints and object query expressions on any Meta-Object Facility model or meta-model that cannot easily be expressed by diagrammatic notation.
- [Kermeta site] (http://www.kermeta.org/)
- [Model Driven Language Engineering with Kermeta] (http://www.irisa.fr/triskell/publis/2010/Jezequel10b.pdf)
- [Weaving Executability into Object-Oriented Meta-Languages] (http://www.kermeta.org/documents/articles/about_kermeta/bibfolder/Muller05a)
- [Kermeta manual] (http://ecariou.perso.univ-pau.fr/cours/idm/docs/KerMeta-Manual.pdf)