integrating graphical and textual modelling languages

20
Integrating Graphical and Textual Modelling Languages Luc Engelen and Mark van den Brand

Upload: honora

Post on 10-Feb-2016

57 views

Category:

Documents


0 download

DESCRIPTION

Integrating Graphical and Textual Modelling Languages. Luc Engelen and Mark van den Brand. Integrating Metamodel-based and Grammar-based Modelling Languages. Luc Engelen and Mark van den Brand. Overview. Problem description Two approaches Two implementations Case study - PowerPoint PPT Presentation

TRANSCRIPT

Page 1: Integrating Graphical and Textual Modelling Languages

Integrating Graphical and Textual Modelling Languages

Luc Engelen and Mark van den Brand

Page 2: Integrating Graphical and Textual Modelling Languages

Integrating Metamodel-based and Grammar-based Modelling Languages

Luc Engelen and Mark van den Brand

Page 3: Integrating Graphical and Textual Modelling Languages

/ Software Engineering and Technology PAGE 329-3-2009

Overview

1. Problem description2. Two approaches3. Two implementations4. Case study5. Advanced applications6. Conclusions

Page 4: Integrating Graphical and Textual Modelling Languages

/ Software Engineering and Technology PAGE 429-3-2009

Problem description

Page 5: Integrating Graphical and Textual Modelling Languages

/ Software Engineering and Technology PAGE 529-3-2009

Extract (M2T) Convert and transform (T2M) Merge (M2M)

Two approaches

= XMI-representation of model

= Metamodel-based model fragment = Metamodel-based model

= Grammar-based model fragment

Interpret as XMI Rewrite (T2T) Interpret as ‘model’

Page 6: Integrating Graphical and Textual Modelling Languages

/ Software Engineering and Technology PAGE 629-3-2009

• Embedding in a custom language

SendSignalStatement: String

Embedding a textual language

Statement

Assignment MethodCall Textual

• Embedding the UML

Page 7: Integrating Graphical and Textual Modelling Languages

/ Software Engineering and Technology PAGE 729-3-2009

Modelware approach

• Extracting textual fragments

• Merging models andfragments of models

Page 8: Integrating Graphical and Textual Modelling Languages

/ Software Engineering and Technology PAGE 829-3-2009

Modelware approach

• Convert and transform

LS ::= S { “;” S } S ::= “stat”

LS

S CFsourcetarget

Page 9: Integrating Graphical and Textual Modelling Languages

/ Software Engineering and Technology PAGE 929-3-2009

Modelware approach

• Convert and transform

LS ::= S { “;” S } S ::= “stat”

LS

S CFsourcetarget

stat; stat; stat s: S s: S s: S

list: LS

f:CF f:CF

Page 10: Integrating Graphical and Textual Modelling Languages

/ Software Engineering and Technology PAGE 1029-3-2009

Modelware approach

• Convert and transform

LS ::= S { “;” S } S ::= “stat”

LS

S CFsourcetarget

stat; stat; stats: S s: S s: S

list: LS

Page 11: Integrating Graphical and Textual Modelling Languages

/ Software Engineering and Technology PAGE 1129-3-2009

Modelware approach

• Convert and transform

LS ::= S { “;” S } S ::= “stat”

stat; stat; stats: S s: S s: S

list: LS

s: S

LS

S

s: S s: S

list: LST2M M2M

LS

S CFsourcetarget

Page 12: Integrating Graphical and Textual Modelling Languages

/ Software Engineering and Technology PAGE 1229-3-2009

Grammarware approach

• Rewriting

<packagedElement xmi:type="uml:Class" xmi:id="_id1" name="A"> <ownedAttribute xmi:id="_id2" name="a" type="_id3"/> <ownedOperation xmi:id="_id4" name="n" method="_id5"> </ownedOperation> <ownedBehavior xmi:type=“uml::OpaqueBehavior" xmi:id=“_id6"> <body>behavior{ a := n(a) }</body> </ownedBehavior></packagedElement>

Class2Id[(A, _id1), …]Attribute2Id[(A, a, _id2, _id3), …]Operation2Id[A, n, _id4), …]

• Textual fragments use names, XMI uses Identifiers

Page 13: Integrating Graphical and Textual Modelling Languages

/ Software Engineering and Technology PAGE 1329-3-2009

Grammarware approach

T( A “:=” B ) → <effect xsi:type = “slco:AssignmentStatement”/> T(B) T(A) </effect>T( “false” ) → <expression xsi:type=“slco:BooleanConstantExpression” value=“false”/>

Page 14: Integrating Graphical and Textual Modelling Languages

/ Software Engineering and Technology PAGE 1429-3-2009

Two implementations

• Modelware• Xpand for T2M• Xtext for M2T• Xtend for M2MAll from the openArchitectureWare platform for eclipse

• Grammarware• SDF for the grammars

− XMI grammar off the shelf− Custom grammars for the fragments

• ASF for the T2T transformation

Page 15: Integrating Graphical and Textual Modelling Languages

/ Software Engineering and Technology PAGE 1529-3-2009

Case study

Page 16: Integrating Graphical and Textual Modelling Languages

/ Software Engineering and Technology PAGE 1629-3-2009

Case study

Page 17: Integrating Graphical and Textual Modelling Languages

/ Software Engineering and Technology PAGE 1729-3-2009

Observations

• Modelling in eclipse• Diagrams• Simple textual models• Structure editing

• Our approaches add• Embedding of textual fragments in metamodel based models

• Modelware• Restricted to LL(*) grammar• Straightforward mapping from grammar to metamodel

• Grammarware• Forces switching between environments• Deals with plain XMI

− Tool-specific− Low level of abstraction

Page 18: Integrating Graphical and Textual Modelling Languages

/ Software Engineering and Technology PAGE 1829-3-2009

Advanced applications

<packagedElement xmi:type="uml:Class" xmi:id="_id1" name="A"> <ownedAttribute xmi:id="_id2" name="a" type="_id3"/> <ownedOperation xmi:id="_id4" name="n" method="_id5"> </ownedOperation> <ownedBehavior xmi:type=“uml::OpaqueBehavior" xmi:id=“_id6"> <body>behavior{ a := m(a) }</body> </ownedBehavior></packagedElement>

Method “m” not found in class “A”

Page 19: Integrating Graphical and Textual Modelling Languages

/ Software Engineering and Technology PAGE 1929-3-2009

Conclusions

• Embedding grammar-based languages in metamodel-based languages• Two approaches

− Modelware− Grammarware

• Two implementations• Case study: textual alternative for UML activity

diagrams

Page 20: Integrating Graphical and Textual Modelling Languages

/ Software Engineering and Technology PAGE 2029-3-2009

Conclusions

• Grammarware approach and implementation• Flexible grammar definitions• Dealing with XMI

• Modelware approach and implementation• Only one modelling environment• Conversion and transformation in two steps