Chapter 1. Introduction

This document addresses people who want either to use 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 done via the following steps, which some of them are optional. We will detail them in the later sections. So, creating an EMF model consists on :

  1. creating an meta-model in ecore format, following a few constraints that make its instances loadable by Kermeta

  2. creating a model, as an instance of the above meta-model, which we call, as you noticed, EMF model

  3. loading this model and manipulating it with a Kermeta transformation

  4. saving this model, or another model created from scratch with Kermeta.

[Important]Important
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
[Tip]Tip
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 !

1.1. Required knowledge

  1. People who read this document need to have some more or less precise knowledge about either EMOF or ECore metamodels

  2. since ecore is used, people should have a minimal knowledge, as end-users, of Eclipse development environment.

1.2. Terminology and format used in this tutorial

  1. metamodel : we will talk about metamodel and ecore model to design the same thing, e.g the metamodel level. Ecore model is the Eclipse term for a metamodel written in ecore.

  2. instance : in the context of this tutorial, we'll use instance to refer to an instance of the metamodel, i.e an EMF model. Sometimes we will talk about instance-model (an EMF model that is an instance of the metamodel), so, don't get confused.

  3. model object, root class : this term (which correspond to the Model Object in Eclipse words) does not really mean anything, but, at least in the dynamic editor provided by EMF , you can only create instances of classes through a root class that contains the others. A root class is the only class that has no container (so, no “black-diamonded” relation points to it).

  4. containment : this term is important, since you will have to set this property for attributes/references of any class in order to allow to access all the instances of the EMF model through the model object, which is aimed at being the highest-level container (you will see that at the 10th step of section 2.1, p.3, and fig )

1.3. Required environment

The needed environment to create EMF models is the following, for any OS :

  1. Eclipse, preferably the 3.1.1 version

  2. Java 1.5

  3. Ideally, Omondo, that provides a graphical editor of ecore metamodels

  1. Kermeta plugin (remote site for a direct eclipse installation : http://www.kermeta.org/update ), version 0.1.0

  2. EMF modeling framework, version 2.1.0 (remote site : Eclipse update site)

You will find the necessary plugins by using Eclipse installation tool. This can be found through the tool bar menu : Help > Find and install > Search for new features to install > Next buttons