Top Banner
Graphical editor based on models: GMF/Sirius Maestría en ingeniería de software Uniandes
46

Graphical editor based on models: GMF/Siriusmiso... · GMF Overview “The Eclipse Graphical Modeling Framework (GMF) provides a generative component and runtime infrastructure for

Jul 12, 2020

Download

Documents

dariahiddleston
Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: Graphical editor based on models: GMF/Siriusmiso... · GMF Overview “The Eclipse Graphical Modeling Framework (GMF) provides a generative component and runtime infrastructure for

Graphical editor based on

models:

GMF/SiriusMaestría en ingeniería de software

Uniandes

Page 2: Graphical editor based on models: GMF/Siriusmiso... · GMF Overview “The Eclipse Graphical Modeling Framework (GMF) provides a generative component and runtime infrastructure for

Agenda

Need for graphical editors

GMF

Sirius

Case study: THALES

Page 3: Graphical editor based on models: GMF/Siriusmiso... · GMF Overview “The Eclipse Graphical Modeling Framework (GMF) provides a generative component and runtime infrastructure for

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

Page 4: Graphical editor based on models: GMF/Siriusmiso... · GMF Overview “The Eclipse Graphical Modeling Framework (GMF) provides a generative component and runtime infrastructure for

Example: JEE reverse engineering tool

(by Edgar Sandoval) Module diagram

Page 5: Graphical editor based on models: GMF/Siriusmiso... · GMF Overview “The Eclipse Graphical Modeling Framework (GMF) provides a generative component and runtime infrastructure for

Example: JEE reverse engineering tool

Layer diagram: is available once a module is chosen

Page 6: Graphical editor based on models: GMF/Siriusmiso... · GMF Overview “The Eclipse Graphical Modeling Framework (GMF) provides a generative component and runtime infrastructure for

How to create instances of

metamodels? Tree notation

Textual notation

Graphical notation

GMF

Page 7: Graphical editor based on models: GMF/Siriusmiso... · GMF Overview “The Eclipse Graphical Modeling Framework (GMF) provides a generative component and runtime infrastructure for

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

Page 8: Graphical editor based on models: GMF/Siriusmiso... · GMF Overview “The Eclipse Graphical Modeling Framework (GMF) provides a generative component and runtime infrastructure for

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

?

Page 9: Graphical editor based on models: GMF/Siriusmiso... · GMF Overview “The Eclipse Graphical Modeling Framework (GMF) provides a generative component and runtime infrastructure for

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

Page 10: Graphical editor based on models: GMF/Siriusmiso... · GMF Overview “The Eclipse Graphical Modeling Framework (GMF) provides a generative component and runtime infrastructure for

Metamodel (Ecore)

The root element (i.e.,

Application) of the

metamodel is hidden for

illustrating purpose

There are bidirectional

references

Page 11: Graphical editor based on models: GMF/Siriusmiso... · GMF Overview “The Eclipse Graphical Modeling Framework (GMF) provides a generative component and runtime infrastructure for

Graphical definition

Is used to define the figures, nodes, links,

etc. that you will display on your diagram

Page 12: Graphical editor based on models: GMF/Siriusmiso... · GMF Overview “The Eclipse Graphical Modeling Framework (GMF) provides a generative component and runtime infrastructure for

Tooling

Palette tools

Context menu actions

Property sheet

Page 13: Graphical editor based on models: GMF/Siriusmiso... · GMF Overview “The Eclipse Graphical Modeling Framework (GMF) provides a generative component and runtime infrastructure for

Mapping

Metamodel

Tool

Definition

Graphical

Definition

Mapping

model

Page 14: Graphical editor based on models: GMF/Siriusmiso... · GMF Overview “The Eclipse Graphical Modeling Framework (GMF) provides a generative component and runtime infrastructure for
Page 15: Graphical editor based on models: GMF/Siriusmiso... · GMF Overview “The Eclipse Graphical Modeling Framework (GMF) provides a generative component and runtime infrastructure for

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

Page 16: Graphical editor based on models: GMF/Siriusmiso... · GMF Overview “The Eclipse Graphical Modeling Framework (GMF) provides a generative component and runtime infrastructure for

A bit of Sirius history

Page 17: Graphical editor based on models: GMF/Siriusmiso... · GMF Overview “The Eclipse Graphical Modeling Framework (GMF) provides a generative component and runtime infrastructure for

Sirius

Based on GMF, EMF and the Eclipse

Platform

Allows one to define multi-view workbenches

including tables, trees or diagrams

Page 19: Graphical editor based on models: GMF/Siriusmiso... · GMF Overview “The Eclipse Graphical Modeling Framework (GMF) provides a generative component and runtime infrastructure for

Diagram

Page 20: Graphical editor based on models: GMF/Siriusmiso... · GMF Overview “The Eclipse Graphical Modeling Framework (GMF) provides a generative component and runtime infrastructure for

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

Page 21: Graphical editor based on models: GMF/Siriusmiso... · GMF Overview “The Eclipse Graphical Modeling Framework (GMF) provides a generative component and runtime infrastructure for

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

Page 22: Graphical editor based on models: GMF/Siriusmiso... · GMF Overview “The Eclipse Graphical Modeling Framework (GMF) provides a generative component and runtime infrastructure for

Mapping

Types of mapping

Node

Container

Edge

Conditional

Page 23: Graphical editor based on models: GMF/Siriusmiso... · GMF Overview “The Eclipse Graphical Modeling Framework (GMF) provides a generative component and runtime infrastructure for

Node

Is used to represent model elements

graphically as atomic elements, i.e., elements

which can not contain other elements

maps to

Page 24: Graphical editor based on models: GMF/Siriusmiso... · GMF Overview “The Eclipse Graphical Modeling Framework (GMF) provides a generative component and runtime infrastructure for

Node

Page 25: Graphical editor based on models: GMF/Siriusmiso... · GMF Overview “The Eclipse Graphical Modeling Framework (GMF) provides a generative component and runtime infrastructure for

Node

Page 26: Graphical editor based on models: GMF/Siriusmiso... · GMF Overview “The Eclipse Graphical Modeling Framework (GMF) provides a generative component and runtime infrastructure for

Container Is used to represent model elements

graphically as containers, which can contain

sub-elements (including other containers,

recursively)

maps to

Page 27: Graphical editor based on models: GMF/Siriusmiso... · GMF Overview “The Eclipse Graphical Modeling Framework (GMF) provides a generative component and runtime infrastructure for

Container

Page 28: Graphical editor based on models: GMF/Siriusmiso... · GMF Overview “The Eclipse Graphical Modeling Framework (GMF) provides a generative component and runtime infrastructure for

Container

Page 29: Graphical editor based on models: GMF/Siriusmiso... · GMF Overview “The Eclipse Graphical Modeling Framework (GMF) provides a generative component and runtime infrastructure for

Edge

Is used to define connections between

diagram elements.

Two kinds of edges:

Relation-Based Edges

Domain-Based Edges

Page 30: Graphical editor based on models: GMF/Siriusmiso... · GMF Overview “The Eclipse Graphical Modeling Framework (GMF) provides a generative component and runtime infrastructure for

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

Page 31: Graphical editor based on models: GMF/Siriusmiso... · GMF Overview “The Eclipse Graphical Modeling Framework (GMF) provides a generative component and runtime infrastructure for

[self.cartographyElements-> collect(r|r.migRelations) -

>select(r|r.dest.parentModule.eGet('name') <>self.name) ->

collect(c|c.dest.parentModule)/]

Page 32: Graphical editor based on models: GMF/Siriusmiso... · GMF Overview “The Eclipse Graphical Modeling Framework (GMF) provides a generative component and runtime infrastructure for

Relation-based edge

Page 33: Graphical editor based on models: GMF/Siriusmiso... · GMF Overview “The Eclipse Graphical Modeling Framework (GMF) provides a generative component and runtime infrastructure for

Domain-Based Edges

Are used when a semantic model element (instead

of simply a reference) exists to represent the relation

itself

maps to

Page 34: Graphical editor based on models: GMF/Siriusmiso... · GMF Overview “The Eclipse Graphical Modeling Framework (GMF) provides a generative component and runtime infrastructure for

Domain-based edge

Page 35: Graphical editor based on models: GMF/Siriusmiso... · GMF Overview “The Eclipse Graphical Modeling Framework (GMF) provides a generative component and runtime infrastructure for

Conditional style

Makes it possible to support different

graphical aspects for a single mapping

Page 36: Graphical editor based on models: GMF/Siriusmiso... · GMF Overview “The Eclipse Graphical Modeling Framework (GMF) provides a generative component and runtime infrastructure for

Conditional

Page 37: Graphical editor based on models: GMF/Siriusmiso... · GMF Overview “The Eclipse Graphical Modeling Framework (GMF) provides a generative component and runtime infrastructure for

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

Page 38: Graphical editor based on models: GMF/Siriusmiso... · GMF Overview “The Eclipse Graphical Modeling Framework (GMF) provides a generative component and runtime infrastructure for

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

Page 39: Graphical editor based on models: GMF/Siriusmiso... · GMF Overview “The Eclipse Graphical Modeling Framework (GMF) provides a generative component and runtime infrastructure for

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)

Page 40: Graphical editor based on models: GMF/Siriusmiso... · GMF Overview “The Eclipse Graphical Modeling Framework (GMF) provides a generative component and runtime infrastructure for

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

Page 41: Graphical editor based on models: GMF/Siriusmiso... · GMF Overview “The Eclipse Graphical Modeling Framework (GMF) provides a generative component and runtime infrastructure for
Page 42: Graphical editor based on models: GMF/Siriusmiso... · GMF Overview “The Eclipse Graphical Modeling Framework (GMF) provides a generative component and runtime infrastructure for

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

Page 43: Graphical editor based on models: GMF/Siriusmiso... · GMF Overview “The Eclipse Graphical Modeling Framework (GMF) provides a generative component and runtime infrastructure for
Page 44: Graphical editor based on models: GMF/Siriusmiso... · GMF Overview “The Eclipse Graphical Modeling Framework (GMF) provides a generative component and runtime infrastructure for

Functional analysis (requirements)

Page 45: Graphical editor based on models: GMF/Siriusmiso... · GMF Overview “The Eclipse Graphical Modeling Framework (GMF) provides a generative component and runtime infrastructure for

MARTE multi-view workbench

Page 46: Graphical editor based on models: GMF/Siriusmiso... · GMF Overview “The Eclipse Graphical Modeling Framework (GMF) provides a generative component and runtime infrastructure for

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