SDA SE Wiki

Software Engineering for Smart Data Analytics & Smart Data Analytics for Software Engineering

User Tools

Site Tools


Assignment 10: Model Driven Engineering - MOF, Xtext

Release date: Tuesday, 18.12.12 - Due date: Sunday, 06.01.13, 23:59


Task 41. UML Profiles and MOF based Meta Models

4 Points

Discuss and present the main advantages and disadvantages of UML Profiles in comparison to MOF‐based Meta‐models.


Task 42. Create a UML Profile for a Component Model

6 Points

This task will model ports and components according to the following description:

Components have ports, which have required and provided interfaces. An interface has a name and contains at least one method. An interface may be used in several components.

Your task is to define a meta-model with stereotypes for the elements. For the definition of the profile you can use a UML2 tool of your choice (or use a simple class diagram where you use a directed association with the stereotype «extension» instead of the extension arrows). See slide 25 of the Model Driven Engineering lecture for an example.

Create an exemplary class diagram and annotate the model elements accordingly.

[Yes, UML knows already components, interfaces and ports. Let's just assume these were not there and we need to model them with stereotypes on classes and associations.]  


Task 43. Prerequisite: Installing EMF

0 Points

In this assignment sheet we want to create an Ecore meta-model and domain specific language (DSL) editor with the help of the Xtext framework. In the end it should be possible to define a software architecture based on components.

Installation of Eclipse Modeling Framework (EMF) can be done in Eclipse via the Eclipse Update Manager. In this dialog select “Modeling” and install the “EMF – Eclipse Modeling Framework SDK” as well as the “Ecore Tools”.

A good tutorial on using the EMF framework for modeling is written by Lars Vogel:

To get acquainted with Xtext, read the following tutorial:


Task 44. Define an Ecore Meta-model with EMF

6 Points

[Requires Task 43.]

Your task is to build a meta-model for the component model (described in Task 42) based on Ecore.

As a starting point we provided a project. Import the project into your Eclipse workspace. All relevant files are stored in the top level directory of it.

You have two options to create the Ecore meta-model for the described component model. You can either edit the Ecore components.ecore file directly, or use the graphical Ecore Diagram Editor to edit the file components.ecorediag.

The starting point is the System class, which should contain all defined (toplevel) elements.

In the case you are using the diagram editor,

If you want to gain more insights

Tip for references between classes


Task 45. Prerequisite: Installing Xtext 2.x

0 Points

In the following tasks we will use Xtext2.x for Eclipse. You can find more information and screencasts about the tool on their website

It can be either installed from an Eclipse Update Site, through the Eclipse Marketplace or by Drag & Drop from the “Install Now” button found on the website into your Eclipse.

Create a Java representation for your Ecore model


Task 46. Using Xtext to define a DSL Editor

12 Points

[Requires Task 45.]

Based on the Meta-model of Task 44 create a XText-based DSL. Your grammar should accept examples like the following:

component c
  	port p1 provided I1 I2
	port p2 
	  required I1 I2
	  provided I1 I2
	
interface I1
interface I2

For simplicity reasons, you can restrict the order in which elements (component, interface, etc.) are defined in the file.

Please use the following names for your Xtext project and DSL fileextension:

Project name edu.bonn.atsc.compdsl
Language name edu.bonn.atsc.dsl.Components
DSL-File extension comp

More information about cross-referencing

For guidance on creation of an editor with Xtext, take a look at what you have worked through during the last practical lecture.


If you have question, feel free to ask questions on the mailing list. Enjoy the holiday time as well as the time working with this powerful technology. 8-)

teaching/lectures/atsc/2012/assignment_10.txt · Last modified: 2018/05/09 01:59 (external edit)

SEWiki, © 2023