MDSD Example: Transportation Network - Sources
Exercise 03 - Graphical Domain Specific Language
This repository includes the resources of the third task of the MDSD Example "Transportation Network".
Task Description
The main task of the exercise is to create a graphical DSL (domain specific language ) for the domain of transportation networks.
Sirus is a development framework to create model editors from a given metamodel and a view specification. The view specification has a similar purpose as the grammars used in the last exercise and describes e.g. how model elements should be rendered, created, edited, or removed using the the editor. In contrast to Xtext no code is generated in Sirius because the view specification is interpreted at run-time. We will use Sirius to generate a graphical DSL for our transportation networks.
To start the exercise install Sirus and familiarize yourself with the Sirus editor development.
-
Familiarize yourself with Sirius and its capabilities to create graphical model editors based on a given metamodel. Sirius has excellent tutorials12 and documentation3 that are a good starting points.
-
Create a new Sirius project
- Open a new eclipse workspace and
importyour transportation network metamodel projects (Metamodel,Edit, andEditor) in that workspace. Do not use the same workspace as the previous exercise that includes the Xtext projects since Xtext, and Sirus need some further configuration to work together and we want to keep it simple in this exercise. -
RuntheMetamodel Projectas anEclipse Application, like you did to test your metamodel in exercise 1. This will register your metamodel in the new Eclipse instance. In the new Eclipse instance create a newViewpoint Specification Projectand open the View Specification (description/*.odesign) file. Edit this file like it is explained in the tutorials to develop the graphical state machine editor
- Open a new eclipse workspace and
-
Define a graphical modeling editor for your transportation network models by using the View Specification (
description/*.odesign). The editor should be able to render, create, and edit all element types of the transportation network.- Create a Editor to plan Transportation Networks
- Create a Transportation Network Viewer
- Creates Nodes, Container, and Edges representing your
Locations,POIs,RoadNetworks, andRoads. - If needed try add further (secondary) nodes representing your model elements to add mor information to the diagrams.
- As a hint: You can a further layers (other than the mandatory
Defaultone) to the viewer to make some information only visible on demand.
- Creates Nodes, Container, and Edges representing your
- Refine the Viewer ta an Editor
- Add Tools for creating
Locations,POIs,RoadNetworks, andRoads to the editor. - Add Tools for editing existing Information via e.g. Direct Lable Editing
- Add Tools for creating
- Create a Transportation Network Viewer
- Add functionality to plan Routes and manage Vehicles to the editor.
- Add a new layer to the editor to manage routes and Vehicles
- Creates Nodes, Container, and Edges representing your
Routess, andVehicles in the Network. - Add Tools for creating
Routess, andVehicles to the editor. - Add Tools for editing existing Information via e.g. Direct Lable Editing or Dialog windows
- Try to implement the semantics that a present in your textual Editor. E.g.:
-
Road NetworkorRouteshould not self-connect to the sameLocation - Give a visual warning if a
Locationis isolated in the Network - Give a visual warning if there is no
CompanyWarehousein the Network - Numbers, like distances, should be plausible.
-
- Create a Editor to plan Transportation Networks
-
To test the developed editor create a
Modeling Project(not an normal generalProject) withFile\rightarrowNew\rightarrow``Other...in the same Eclipse instance (the one with theViewpoint Specification Project`). You have the right projekt type if there is a `*.aird` file in your project. Add some transportation network model files to it (e.g. use the ones from exercise 1). The editor should open by default. If not, `right-click` on the project (with the model files), click on `Create Representation` and choose your model file.
How To Run the Base Solution
-
Importthestgroup.mdsd.transportation_network.metamodel.*projects in your Eclipse workspace. - In the runtime Eclipse instance
importthestgroup.mdsd.transportation_network.graphical_dsl, andmodel_examplesprojects. - Open the dsl editor inside the
*.airdfilse or rigth-click on the model project and chooseCreate Representationto open a new editor instance.