Top Banner
1 SEGRAVIS-Leicester, 2006-09-09 www.es.tu-darmstadt.de Fachgebiet Echtzeitsysteme 1 From From Model Model- Driven Driven Development Development to to Graph Graph Transformations Transformations and Back and Back Again Again A. Schürr Real-Time Systems Lab TU Darmstadt andy. [email protected] SegraVis Advanced Summer School 8th – 11th September 2006 Leicester, UK SEGRAVIS-Leicester, 2006-09-09 www.es.tu-darmstadt.de Fachgebiet Echtzeitsysteme 2 = + OR: OR: OR: OR: Smuggling Smuggling“ ( “ ( Fujaba‘s Fujaba‘s) Graph ) Graph Transformations Transformations into into the the World of OMG Standards World of OMG Standards
18

From Model-Driven Development to Graph Transformations and ...

Jan 24, 2022

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: From Model-Driven Development to Graph Transformations and ...

1

SEGRAVIS-Leicester, 2006-09-09

ww

w.e

s.tu

-dar

mst

adt.d

e

Fachgebiet Echtzeitsysteme

1

FromFrom ModelModel--DrivenDriven DevelopmentDevelopment to to Graph Graph TransformationsTransformations and Back and Back AgainAgain

A. SchürrReal-Time Systems Lab

TU Darmstadtandy. [email protected]

SegraVis Advanced Summer School8th – 11th September 2006

Leicester, UK

SEGRAVIS-Leicester, 2006-09-09

ww

w.e

s.tu

-dar

mst

adt.d

e

Fachgebiet Echtzeitsysteme

2

== ++

OR:OR:

OR:OR:

„„SmugglingSmuggling“ (“ (Fujaba‘sFujaba‘s) Graph ) Graph TransformationsTransformationsintointo thethe World of OMG StandardsWorld of OMG Standards

Page 2: From Model-Driven Development to Graph Transformations and ...

2

SEGRAVIS-Leicester, 2006-09-09

ww

w.e

s.tu

-dar

mst

adt.d

e

Fachgebiet Echtzeitsysteme

3

A. SchürrReal-Time Systems Lab

TU Darmstadtandy. [email protected]

== ++

OR:OR:

SEGRAVIS-Leicester, 2006-09-09

ww

w.e

s.tu

-dar

mst

adt.d

e

Fachgebiet Echtzeitsysteme

4

OutlineOutline of of PresentationPresentation

• Languages and Tools for Model-Driven DevelopmentOMG´s Model Driven Architecture (MDA)Model-Driven Software Development (MDD)MDD requirements derived from industrial case study

• From MDD to the World of Graph TransformationsComparison of Meta-Case, Model/Graph Transformation ToolsMOFLON = OMG standards + graph transformation technologyMOFLON architecture and sublanguages

• … and Back AgainStatus quo and future of MOFLONStatus quo of MDA/MDD/DSL/Meta-Case/… tools in general

Page 3: From Model-Driven Development to Graph Transformations and ...

3

SEGRAVIS-Leicester, 2006-09-09

ww

w.e

s.tu

-dar

mst

adt.d

e

Fachgebiet Echtzeitsysteme

5

Transformation

Transformation

Transformation

Computational Independent ModelCIM

Platform Specific ModelPSM

Code

Platform Independent ModelPIM

Requirements

System

DSL3 MetamodelDSL3 Metamodel

DSL2 MetamodelDSL2 Metamodel

DSL1 MetamodelDSL1 Metamodel

describe

describe

describe

OMG´sOMG´s MModel odel DDrivenriven AArchitecturerchitecture

MOF

describe

describe

describe

OMG often recommends:DSL1 = DSL2 = DSL3 = UML

• CIM = Computer Independent Model• PIM = Platform Independent Model• PSM = Platform Specific Model• MOF = Meta Object Facility (NOT Microsoft Ops. Framework )• UML = Unified Modeling Language• DSL = Domain-Specific Language

SEGRAVIS-Leicester, 2006-09-09

ww

w.e

s.tu

-dar

mst

adt.d

e

Fachgebiet Echtzeitsysteme

6

M0

M1

M2

OMG´sOMG´s MModel odel DDrivenriven AArchitecturerchitecture

Model

Metamodel

System

Meta-metamodel

describe

describe

describe

describePIM PSM

M3 Superstructure

InfrastructureMOF

UML Metamodel

(Meta-)Modeling Levels Infrastructure = UML ∩ MOF

Page 4: From Model-Driven Development to Graph Transformations and ...

4

SEGRAVIS-Leicester, 2006-09-09

ww

w.e

s.tu

-dar

mst

adt.d

e

Fachgebiet Echtzeitsysteme

7Requirements

Software Design

ECU HousingTesting

Product DataHardware Design

Consistency?

Real Real ModelModel--DrivenDriven DevelopmentDevelopment ScenarioScenario

SEGRAVIS-Leicester, 2006-09-09

ww

w.e

s.tu

-dar

mst

adt.d

e

Fachgebiet Echtzeitsysteme

8

ModelModel--DrivenDriven DevelopmentDevelopment RequirementsRequirements

Rapid Development (generating) of

• Tool wrappers for „COTS“ tools• New tools for domain-specific languages• Local model analysis/transformation support• Inter-model consistency checking / change propagation• Traceability link management support• Bidirectional model update propagation• Data import / export (code generators, parser, … )• Integrated model version management• …

Page 5: From Model-Driven Development to Graph Transformations and ...

5

SEGRAVIS-Leicester, 2006-09-09

ww

w.e

s.tu

-dar

mst

adt.d

e

Fachgebiet Echtzeitsysteme

9

Code-Fragment

Modell

MModelodel--DDrivenriven DDevelopmentevelopment ArchitectureArchitecture

ModelRepresentation

Model Parser& Generator

(PIM) MetaObjects

ModelTranslator

(PSM) MetaObjects

Code Parser & Generator

CodeFragments

TextTemplates

RepresentationGrammar

MetaModel

ModelTranslations

MetaModel

ModelAnalyser

ModelTransformer

Code-FragmentAnalysisResults

Model Trans-formations

ModelConstraints

Text<->ModelTranslations

RepresentationGrammar

TextTemplates

ModelEditor

GUISpecification

SEGRAVIS-Leicester, 2006-09-09

ww

w.e

s.tu

-dar

mst

adt.d

e

Fachgebiet Echtzeitsysteme

10

Code-Fragment

Modell

Standard Standard MetaMeta--CaseCase Tool (DSL) Tool (DSL) ScenarioScenario

ModelRepresentation

Model Parser& Generator

MetaObjects

CodeGenerator

CodeFragments

TextTemplates

MetaModel

ModelAnalyser

ModelTransformer

Code-FragmentAnalysisResults

Model Trans-formations

ModelConstraints

ModelEditor

GUISpecification

Meta-Case Tools usually generateDomain-Specific Model Editors(+ Analyzer + … in some cases)

Page 6: From Model-Driven Development to Graph Transformations and ...

6

SEGRAVIS-Leicester, 2006-09-09

ww

w.e

s.tu

-dar

mst

adt.d

e

Fachgebiet Echtzeitsysteme

11

Elements of a Elements of a CompleteComplete MetaMeta--DSLDSL

MetamodelDef. Language

(Abstract Syntax)

MetamodelDef. Language

(Abstract Syntax)

GUI Def. Language

(Concrete Syntax)

GUI Def. Language

(Concrete Syntax)

ConstraintDef. Language

(Static Semantics)

ConstraintDef. Language

(Static Semantics)

TransformationDef. Language

(Dyn. Semantics)

TransformationDef. Language

(Dyn. Semantics)

Model-to-ModelTranslation

Def. Language

Model-to-ModelTranslation

Def. Language

Code/TextGenerator & Parser

Def. Language

Code/TextGenerator & Parser

Def. Language

SEGRAVIS-Leicester, 2006-09-09

ww

w.e

s.tu

-dar

mst

adt.d

e

Fachgebiet Echtzeitsysteme

12

Elements of Elements of OMG´sOMG´s MDA WorldMDA World

MOF 2.0Metamodel

Def. Language

MOF 2.0Metamodel

Def. Language

No GUI DefinitionLanguage

No GUI DefinitionLanguage

OCL 2.0Constraint

Def. Language

OCL 2.0Constraint

Def. Language

(QVT 1.0)TransformationDef. Language

(QVT 1.0)TransformationDef. Language

QVT 1.0M2M TranslationDef. Language

QVT 1.0M2M TranslationDef. Language

Model-to-TextTransformation

RFP

Model-to-TextTransformation

RFP

Page 7: From Model-Driven Development to Graph Transformations and ...

7

SEGRAVIS-Leicester, 2006-09-09

ww

w.e

s.tu

-dar

mst

adt.d

e

Fachgebiet Echtzeitsysteme

13

TheThe MetaMeta--CaseCase Tool World of Tool World of MetaEditMetaEdit++

MetamodelDef. LanguageMetamodel

Def. Language

Concrete SyntaxDef. Language

Concrete SyntaxDef. Language

Analysis ReportDef. Language

Analysis ReportDef. Language

(API)TransformationDef. Language

(API)TransformationDef. Language

(API)M2M TranslationDef. Language

(API)M2M TranslationDef. Language

Code GeneratorDef. Language

Code GeneratorDef. Language

SEGRAVIS-Leicester, 2006-09-09

ww

w.e

s.tu

-dar

mst

adt.d

e

Fachgebiet Echtzeitsysteme

14

Elements of Elements of Fujaba´sFujaba´s ModelingModeling WorldWorld

UML 1.x likeMetamodel

Def. Language

UML 1.x likeMetamodel

Def. Language

GUI Def. Language

GUI Def. Language

ConstraintDef. Language

ConstraintDef. Language

SDMTransformationDef. Language

SDMTransformationDef. Language

TGGM2M TranslationDef. Language

TGGM2M TranslationDef. Language

Template-BasedCode GeneratorDef. Language

Template-BasedCode GeneratorDef. Language

Page 8: From Model-Driven Development to Graph Transformations and ...

8

SEGRAVIS-Leicester, 2006-09-09

ww

w.e

s.tu

-dar

mst

adt.d

e

Fachgebiet Echtzeitsysteme

15

MDD / DSL MDD / DSL LanguagesLanguages -- SummarySummary

Velocity-Cart-ridgesTCS-

Code Gen. Def. Lang.

… FujabaGME(Vanderbilt)

Arc-Styler

AMMA(INRIA)

OMG Languages

TGGGReAT2AIM2ATL /AMW2QVTM2M Trans.

Def. Lang.

SDMGReAT?ATLQVT1Model TrafoDef. Lang.

--OCLATL /OCLOCL

ConstraintDef. Lang.

-GME 5.0---

GUI Def.Lang.

UML 1.xGME 5.0

UMLProfileKM3MOF

MetamodelDef. Lang.

1: QVT has been designed for model-to-model translation purposes2: ATL, AIM, and GReAT are unidirectional model translation languages

SEGRAVIS-Leicester, 2006-09-09

ww

w.e

s.tu

-dar

mst

adt.d

e

Fachgebiet Echtzeitsysteme

16

MOFLON = OMG Standards + FujabaMOFLON = OMG Standards + Fujaba

• MOF 2.0 as metamodeling languagestandard-complaint metamodeling approachnew modularization / model refinement concepts

• OCL 2.0 as constraint definition languagewell-known textual model property definition languageDresden OCL Compiler (planned add-on: incr. evaluation)

• SDM = graph transformations + UML activity diagramsUML-inspired visual model transformation languagemulti-paradigmatic (rule-based, imperative) approach

• (V)TGGs = MOF-compliant triple graph grammarsbidirectional, declarative model translation approachplanned add-on: declarative view-definition approach

• JMI-compliant Java code generators (Sun Standard)

Page 9: From Model-Driven Development to Graph Transformations and ...

9

SEGRAVIS-Leicester, 2006-09-09

ww

w.e

s.tu

-dar

mst

adt.d

e

Fachgebiet Echtzeitsysteme

17

Elements of Elements of MOFLON´sMOFLON´s WorldWorld

MOF 2.0Metamodel

Def. Language

MOF 2.0Metamodel

Def. Language

DIAGEN Add-On:Visual Editor

Generator

DIAGEN Add-On:Visual Editor

Generator

OCL 2.0Constraint

Def. Language

OCL 2.0Constraint

Def. Language

SDMTransformationDef. Language

SDMTransformationDef. Language

(V)TGGM2M TranslationDef. Language

(V)TGGM2M TranslationDef. Language

XSLT/VelocityCode GeneratorsXSLT/Velocity

Code Generators

modifiedmodified

newnew

unchangedunchanged

SEGRAVIS-Leicester, 2006-09-09

ww

w.e

s.tu

-dar

mst

adt.d

e

Fachgebiet Echtzeitsysteme

18

With further 86 constraints 101 improvements were made, whereas

From 90 analyzed constraints of the specification48 (53%)

are correct42 (47%)

are erroneous

50 (50%)are additional

51 (50%)are corrections

From the 51 corrections of the specification

16 (29%)are due to a wrong

metamodel reference

19 (34%)are due to wrong semantics

21 (37%)are due to wrong syntax

WhyWhy ModificationsModifications of MOF 2.0 ?of MOF 2.0 ?

Page 10: From Model-Driven Development to Graph Transformations and ...

10

SEGRAVIS-Leicester, 2006-09-09

ww

w.e

s.tu

-dar

mst

adt.d

e

Fachgebiet Echtzeitsysteme

19

TypicalTypical MOFLON MOFLON ApplicationsApplications

• system engineering tool integration(ToolNet project with DaimlerChrysler et al.)

• model analysis / design guideline checking(Matlab Simulink/Stateflow with DaimlerChrysler et al.)

• software analysis / reverse engineering(based on experiences at Philips Medical Research)

• visual DSL editor development(ECLIPSE plug-ins in cooperation with UniBw)

• …

SEGRAVIS-Leicester, 2006-09-09

ww

w.e

s.tu

-dar

mst

adt.d

e

Fachgebiet Echtzeitsysteme

20

JAVA CodeTool

Logic

ImportImportXMICASE

ToolsCASETools

Code GeneratorsCode Generators

M O F L O NMeta Models

MOFLON MOFLON ArchitectureArchitecture

MOF 2.0 OCL GT TGG

Visual EditorsVisual Editors

JMIAccess methods (typed, reflective)

XML persistency

JMIAccess methods (typed, reflective)

XML persistency

Extra FeaturesEvent Notification

Constraint checking & repair

Extra FeaturesEvent Notification

Constraint checking & repair

Page 11: From Model-Driven Development to Graph Transformations and ...

11

SEGRAVIS-Leicester, 2006-09-09

ww

w.e

s.tu

-dar

mst

adt.d

e

Fachgebiet Echtzeitsysteme

21

RunningRunning ExampleExample: Model : Model integrationintegration

DOORS: RequirementsEngineering Tool

Enterprise Architect:UML Modeling Tool

SEGRAVIS-Leicester, 2006-09-09

ww

w.e

s.tu

-dar

mst

adt.d

e

Fachgebiet Echtzeitsysteme

22

Model Model InstanceInstance = = ObjectObject GraphGraph:FormalModule

name=“Cruise Control”

:FormalObjectheading=“UseCase”

:FormalObjectheading=“Detect ...”

:FormalObjectheading=“Attributes”

:FormalObjectheading=“Control...”

Page 12: From Model-Driven Development to Graph Transformations and ...

12

SEGRAVIS-Leicester, 2006-09-09

ww

w.e

s.tu

-dar

mst

adt.d

e

Fachgebiet Echtzeitsysteme

23

Metamodel Metamodel forfor DOORSDOORS

SEGRAVIS-Leicester, 2006-09-09

ww

w.e

s.tu

-dar

mst

adt.d

e

Fachgebiet Echtzeitsysteme

24

Metamodel Metamodel forfor Enterprise Enterprise ArchitectArchitect

Page 13: From Model-Driven Development to Graph Transformations and ...

13

SEGRAVIS-Leicester, 2006-09-09

ww

w.e

s.tu

-dar

mst

adt.d

e

Fachgebiet Echtzeitsysteme

25

Triple Graph Grammar Integration SchemaTriple Graph Grammar Integration Schema

Graph Schema 1 Graph Schema 2 Graph Schema 3

SEGRAVIS-Leicester, 2006-09-09

ww

w.e

s.tu

-dar

mst

adt.d

e

Fachgebiet Echtzeitsysteme

26

TripleTriple Graph Graph GrammarGrammar Integration Integration RuleRule

Object Graph 1 Object Graph 2 Object Graph 3

Page 14: From Model-Driven Development to Graph Transformations and ...

14

SEGRAVIS-Leicester, 2006-09-09

ww

w.e

s.tu

-dar

mst

adt.d

e

Fachgebiet Echtzeitsysteme

27

GeneratingGenerating Operational Operational RulesRules

• Integration rules are declarative• Standard SDM rules are generated:

check consistencycreate traceability linksforward transformationbackward transformationforward attribute propagationbackward attribute propagationremove traceability linksforward deletion propagationbackward deletion propagation…

Example: Generate use case diagrams from requirements

SEGRAVIS-Leicester, 2006-09-09

ww

w.e

s.tu

-dar

mst

adt.d

e

Fachgebiet Echtzeitsysteme

28

Code-Fragment

Modell

Forward Transformation Forward Transformation ScenarioScenario

ModelRepresentation Model Parser (PIM) Meta

Objects

ModelTranslator

(PSM) MetaObjects

Code Generator

CodeFragments

Velocity / XLSTTemplates

EBNF / XSLTLang. Defs.

MOFMeta Model

(V)TGGTranslations

MOFMeta Model

SDM GraphTransformations

generates

Page 15: From Model-Driven Development to Graph Transformations and ...

15

SEGRAVIS-Leicester, 2006-09-09

ww

w.e

s.tu

-dar

mst

adt.d

e

Fachgebiet Echtzeitsysteme

29

StamdardStamdard SDM Transformation SDM Transformation RuleRule

SEGRAVIS-Leicester, 2006-09-09

ww

w.e

s.tu

-dar

mst

adt.d

e

Fachgebiet Echtzeitsysteme

30

Java Code Generation Java Code Generation fromfrom SDMSDM

• JMI-compliant Java codein-memory repositorytype-safe interfacesreflective/generic interfacesXML persistency

• operational transformation rules method bodies

• MDR-compatible interfaces and event mechanism(MDR = Sun’s Meta Data Repository)

• Under Development:code for constraint checking (from OCL constraints)code for constraint repairs (from transformations)

Page 16: From Model-Driven Development to Graph Transformations and ...

16

SEGRAVIS-Leicester, 2006-09-09

ww

w.e

s.tu

-dar

mst

adt.d

e

Fachgebiet Echtzeitsysteme

31

ExampleExample: : DevelopedDeveloped Tool IntegrationTool Integration

GeneratedIntegration

Rules

GeneratedIntegration

Rules

ReusableDOORS / JMI

Adapter

ReusableDOORS / JMI

Adapter

Generic CASE Tool Integrator Framework (ToolNet)(with Rule Application Strategy)

Generic CASE Tool Integrator Framework (ToolNet)(with Rule Application Strategy)

ReusableEA / JMIAdapter

ReusableEA / JMIAdapter

Source Model Integration Model Target Model

Proprietary Model Proprietary Model

Traceability LinkRepository(RDBMS)

SEGRAVIS-Leicester, 2006-09-09

ww

w.e

s.tu

-dar

mst

adt.d

e

Fachgebiet Echtzeitsysteme

32

Tool Adapter Generation Tool Adapter Generation StrategiesStrategies

COTS Tool API

COTS Tool Impl.

Refl./Generic JMIInterface

Manual JMI / ToolAdapter Impl.

Typed JMIInterface

GeneratedJMI / JMI Adapter

Refl./Generic JMIInterface

Typed JMIInterface

GeneratedModel Repository

COTS Tool API

COTS Tool Impl.

Typed JMIInterface

Manual JMI / ToolAdapter Impl.

Refl./Generic JMIInterface

GeneratedJMI / JMI Adapter

COTS Tool API

COTS Tool Impl.

Manual Ex-/ImportTool Impl.

Extensible AdapterRealization

Hard-Wired AdapterRealization

Export / ImportBatch Realization

Page 17: From Model-Driven Development to Graph Transformations and ...

17

SEGRAVIS-Leicester, 2006-09-09

ww

w.e

s.tu

-dar

mst

adt.d

e

Fachgebiet Echtzeitsysteme

33

Code-Fragment

Modell

SummarySummary of MOFLON MDD Worldof MOFLON MDD World

ModelRepresentation

Model Parser& Generator

(PIM) MetaObjects

ModelTranslator

(PSM) MetaObjects

Code Parser & Generator

CodeFragments

Velocity / XLSTTemplates

EBNF / XSLTLang. Defs.

MOFMeta Model

(V)TGGTranslations

MOFMeta Model

ModelAnalyser

ModelTransformer

Code-FragmentAnalysisResults

SDM GraphTransformations

OCLConstraints

Text<->ModelTranslations

RepresentationGrammar

TextTemplates

ModelEditor

DiaGen Ed.Specification

SEGRAVIS-Leicester, 2006-09-09

ww

w.e

s.tu

-dar

mst

adt.d

e

Fachgebiet Echtzeitsysteme

34

Open Problems & Open Problems & OngoingOngoing WorkWork

• Metamodeling with MOF 2.0missing UML concepts (association classes)integration with UML profile definition

• Constraint Definition with OCL 2.0incremental (event-driven) constraint checkingintegration with transactions & repair actions

• Local Model Transformations with SDMhandling of composition hierarchies (still a problem!)integrated formal definition of language mix

• Model To Model Transformations with TGGshandling of complex attribute evaluations (still a problem!)…

• Integration with Editor Generator Framework DiaGen

Page 18: From Model-Driven Development to Graph Transformations and ...

18

SEGRAVIS-Leicester, 2006-09-09

ww

w.e

s.tu

-dar

mst

adt.d

e

Fachgebiet Echtzeitsysteme

35

…… and Back and Back AgainAgain to MDDto MDD

• Model-Driven Development (MDD) is a “hot topic” of theSoftware Engineering Community

with all the resulting pros and cons …

• MDD combines established techniques of last milleniummeta-modeling / meta-case tool technologystepwise refinement of specifications / modelscompiler compiler technology…

• OMG’s MDA and other institution’s Meta-Case Tools for Domain-Specific Languages (DSLs) are variations of MDD

• Currently available (commercial / academic) MDD toolssupport only subsets of all MDD activitieslacks formal definition (available for graph transformations)