-
-
- Tips and Tricks
Software Engineering for Smart Data Analytics & Smart Data Analytics for Software Engineering
Release date: Tuesday, 18.12.12 - Due date: Sunday, 06.01.13, 23:59
4 Points |
---|
Discuss and present the main advantages and disadvantages of UML Profiles in comparison to MOF‐based Meta‐models.
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.]
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:
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
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
components.genmodel
, right-click onto the package Atsccomps
to generate the corresponding Java model elements: GenerateEMFModelClasses.xml
file.
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
And here is a simple example for the use of cross-references:
events nothingImportant MYEV end state idle nothingImportant => idle end
The grammar rule for the transitions looks like this:
Transition : event=[Event] ’=>’ state=[State] ;
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.