Post on 17-Apr-2018
Graphical editor based on
models:
GMF/SiriusMaestría en ingeniería de software
Uniandes
Agenda
Need for graphical editors
GMF
Sirius
Case study: THALES
Materials taken from
http://www.eclipse.org/epsilon/doc/articles/eu
genia-gmf-tutorial/
http://wiki.eclipse.org/index.php/GMF_Tutoria
l
Artem Tikhomirov & Alexander Shatalin.
Introduction to the Graphical Modeling
Framework. 2008.
http://fmadiot.blogspot.com/2012/04/performi
ng-multi-viewpoint-analysis.html
http://www.eclipse.org/sirius/doc/specifier/Siri
us%20Specifier%20Manual.html
Example: JEE reverse engineering tool
(by Edgar Sandoval) Module diagram
Example: JEE reverse engineering tool
Layer diagram: is available once a module is chosen
How to create instances of
metamodels? Tree notation
Textual notation
Graphical notation
GMF
GMF Overview
“The Eclipse Graphical Modeling Framework (GMF) provides a
generative component and runtime infrastructure for developing
graphical editors based on EMF and GEF[1].”
Significantly reduces cost of DSL tooling
GMF is part of Eclipse Modeling Project
GMF-generated solutions proved by .ecore diagram editor
[1] GEF is an MVC-based framework to create graphical editors
Building diagram editor with GMF,
basic steps
Design EMF domain meta-model
Create graphical representations for diagram nodes/links
Define diagram structure and generate code
?
GMF architecture: GMF Tooling
Set of models to define diagram editor - capturing
graphical, tooling and meta-modeling aspects.
Extensible code generator, capable to customize
generated code to match specific requirements
Generator Model
(GMFGen)Java code
Mapping (GMFMap)
Tool Definition
(GMFTool)
Graphical Definition
(GMFGraph)
Metamodel
(ECore)
Transformation
M2M
Transformation
M2T
Metamodel (Ecore)
The root element (i.e.,
Application) of the
metamodel is hidden for
illustrating purpose
There are bidirectional
references
Graphical definition
Is used to define the figures, nodes, links,
etc. that you will display on your diagram
Tooling
Palette tools
Context menu actions
Property sheet
Mapping
Metamodel
Tool
Definition
Graphical
Definition
Mapping
model
Mapping definition is tedious in GMF
Solutions
EUGENIA
Sirius
Created in the context of complex systems modeling
Collaboration of people with different concerns
For each concern, there is a viewpoint
A bit of Sirius history
Sirius
Based on GMF, EMF and the Eclipse
Platform
Allows one to define multi-view workbenches
including tables, trees or diagrams
Diagram
The content of the Diagram Description is
mostly made of mappings, and their
associated tools. In addition, it can also
contain filters and layout configuration
information.
Diagram
Mapping Maps semantic elements onto some
graphical notation
General mapping description
Domain class: is the type of semantic element
which are represented by the diagram
Defines what diagrams are activated from existing
diagrams
Style: the graphical aspect of the mapping
Expression
Expression Restricts the number of model elements to consider before creating
graphical elements
Is evaluated starting from a context element
Should return a set (possibly empty) of elements in the semantic
model
Keywords used in expressions
OCL
Self makes reference to the domain class of the diagram
EMF
eGet
Sirius
Features makes reference to the container of the current domain class of a
mapping
Types of expressions:
Semantic
Source/Target finder
Mapping
Types of mapping
Node
Container
Edge
Conditional
Node
Is used to represent model elements
graphically as atomic elements, i.e., elements
which can not contain other elements
maps to
Node
Node
Container Is used to represent model elements
graphically as containers, which can contain
sub-elements (including other containers,
recursively)
maps to
Container
Container
Edge
Is used to define connections between
diagram elements.
Two kinds of edges:
Relation-Based Edges
Domain-Based Edges
Relation-Based Edges
Are used to represent a reference between model
elements such as containment, simple or complex
reference
There is no direct
semantic element
but a complex
reference
maps to
[self.cartographyElements-> collect(r|r.migRelations) -
>select(r|r.dest.parentModule.eGet('name') <>self.name) ->
collect(c|c.dest.parentModule)/]
Relation-based edge
Domain-Based Edges
Are used when a semantic model element (instead
of simply a reference) exists to represent the relation
itself
maps to
Domain-based edge
Conditional style
Makes it possible to support different
graphical aspects for a single mapping
Conditional
Filter
A diagram can define any number of filters,
which can be enabled or disabled
dynamically by the user to show or hide some
elements of a diagram
Example:
Filter by kind-of ElementRelation
Layout Algorithms to perform an automatic layout of
all the graphical elements on a diagram
Two kind-of algorithms:
Default
E.g., Ordered Tree Layout
Customized
the default algorithm does not fit your needs, you can
configure some parameters or request for alternate
algorithms (currently only one) directly inside the
viewpoint
Tools
Are used to define the behavior of your
modeler
Two types of tool:
Tools that appear in the diagram’s palette (e.g. a
tool to create a new node)
Tools that are automatically invoked when the
user performs certain operations (e.g. a delete
tool which is triggered when the user deletes an
element from the diagram)
Case study: Thales
Thales is a French multinational company
that designs and builds electrical systems
and provides services for
the aerospace, defense, transportation and s
ecurity markets
Case study: Thales
Thales has integrated and extended several standards
such as MARTE [1], UML, SysML [2], etc. and added
specific graphical editors to support:
Operational analysis
Functional analysis
Logical architecture
Physical architecture
Non functional constraints
Non functional trade-off
Transition to software or hardware
[1] profile to develop Real-Time and Embedded systems
[2] profile for specifying, analyzing, designing, and verifying complex systems that
may include hardware, software, information, personnel, procedures, and facilities
Functional analysis (requirements)
MARTE multi-view workbench
What practicioners say…
For Jean-Luc Voirin, one of the main benefit
of this approach is to avoid exhaustive
modelling. With the multi-viewpoint tooling,
the architects can adjust modelling effort on
major engineering issues