Page tree

Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

You may want to download the slides of the presentation explaining the basic concepts you will explore in this tutorial.

 

Table of Contents

 

Preliminaries

The Eclipse Modeling Framework (EMF) belongs to the most important technologies in the Eclipse world. One of the more recent indicators of this is its being used to describe the very foundation of Eclipse 4 (or e4, which of course sounds way cooler) applications: the application model. We might come back to the application model in the project phase of our practical. Another indication is that EMF has come to be the foundation of most other modeling-related Eclipse projects. Thus, there is important stuff to be learned in this tutorial!

...

Additionally, install the EcoreViz from the Ecore Model Visualization category from the OpenKieler update site: http://rtsys.informatik.uni-kiel.de/~kieler/updatesite/nightly-openkieler/.

...

Image Added

Finding Documentation

For an introduction to EMF, here's a few suggestions to get you started:

...

One last thing before you get started: While working on your model, save and validate it regularly (Edit -> Validate). This will help you find potential problems with your model while you're still able to fix them easily.

Alternative

...

Route - Graphical

...

Creation of

...

a Metamodel

It is entirely possible to model your metamodel graphically. Since the graphical editing of EMF models has changed in the last Eclipse version, this is only mentioned here as alternative route. To generation an Ecore Diagram proceed as mentioned before. Now, right-click on your model file and select Initialize Ecore Diagram... from the context menu. Create a new Design -> Entities representation and select your package in the following step. You can now create and link all the model elements mentioned in the section before. The changes will be integrated in your Ecore model automatically. However, as mentioned before you don't need to edit your model graphically. This procedure is only described here for the sake of completeness.you don't need to edit your model graphically. This procedure is only described here for the sake of completeness.

Inspecting a Model

Nevertheless you may want to inspect your model graphically. Therefore you installed EcoreViz of the OpenKieler suite. While working on your model, you may right-click on your ecore file and select Vizualize Ecore Model. A new Klighd view will open and display your metamodel. Woha!

Image Added

Code Generation

...

We won't touch upon EMF's notification mechanism in this tutorial, but we still wanted to mention it. EMF models can be (and are) used as the main models holding the data edited by applications. The notification mechanisms allow you to add observers to the model that get notified upon a definable set of editing operations executed on the model. Feel free so search the Internet for tutorials and introductions to this topic.

 

Info

This tutorial was originally created by Christoph Daniel Schulze and Miro Spönemann for the Eclipse Project WT 12/13.