This document is aimed at people who want either to use the Eclipse Modeling Framework in order to create an EMF model, and/or to manipulate them using Kermeta. The use of EMF models in Kermeta is achieved through the following steps, which some of them are optional (they are detailed sections):
creating a meta-model in Ecore format, following a few constraints that make its instances loadable by Kermeta;
creating a model, also called an EMF model, as an instance of the above meta-model;
loading this model and manipulating it through a Kermeta program;
saving this model, as well as other ones programmatically created from scratch with Kermeta.
Kermeta is an evolving software and despite that we put a lot of attention to this document, it may contain errors (more likely in the code samples). If you find any error or have some information that improves this document, please send it to us using the bugtracker in the forge:http://gforge.inria.fr/tracker/?group_id=32Last check: v0.1.0
Most of the code presented in this tutorial comes from the FSM sample available on the kermeta web site. Have a try to it for a complete working sample!
Readers are supposed to be familiar to either the EMOF or the Ecore meta-model.
The use of Ecore also supposes readers to have a minimal knowledge, as end-users, of the Eclipse development environment.
meta-model / Ecore model: both terms are used to point to the meta-model level. “Ecore model” corresponds to the Eclipse terminology for a meta-model specified in Ecore.
instance: in the context of this tutorial, the term “instance” is used to refer to an instance of a meta-model, i.e. of an Ecore model. Sometimes we will talk about instance-model (an Ecore model which is an instance of the meta-model), so, don't get confused.
model object / root class: in the scope of the EMF dynamic editor, these terms designate the model root class that contains all other ones. This root class is the only one in a model that has no container (i.e. which has no “black-diamonded” relation pointing to it).
containment: this term designates an important property of classes attributes/references. This property has to be appropriately set, in such a way that all the elements of an instance-model should be accessed from the root class of the model, which is aimed at being the highest-level container (you will see that at the 10th step of section ???, p.???, and fig ).
The required environment, whatever the underlying operating system, for handling EMF models and being able to run the samples provided in this tutorial includes:
Java 1.5;
Eclipse, preferably the 3.1.1 version;
Ideally, Omondo, that provides a graphical editor of Ecore meta-models;
Kermeta plugin (remote site for a direct eclipse installation: http://www.kermeta.org/update ), version 0.1.0;
EMF modeling framework, version 2.1.0 (remote site: Eclipse update site).
Required plugins can be found by using Eclipse installation tool, through the tool bar menu:Help > Find and install > Search for new features to install > Next buttons