200 likes | 368 Views
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
E N D
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 • Advanced applications • Conclusions / Software Engineering and Technology
Problem description / Software Engineering and Technology
Two approaches Extract (M2T) Convert and transform (T2M) Merge (M2M) Interpret as XMI Interpret as ‘model’ Rewrite (T2T) = Metamodel-based model = Metamodel-based model fragment = Grammar-based model fragment = XMI-representation of model / Software Engineering and Technology
Embedding a textual language • Embedding in a custom language Statement Textual SendSignal Assignment MethodCall Statement: String • Embedding the UML / Software Engineering and Technology
Modelware approach • Extracting textual fragments • Merging models andfragments of models / Software Engineering and Technology
Modelware approach S • Convert and transform LS LS ::= S { “;” S } S ::= “stat” source CF target / Software Engineering and Technology
Modelware approach S • Convert and transform LS LS ::= S { “;” S } S ::= “stat” source CF target list: LS s: S f:CF s: S f:CF s: S stat; stat; stat / Software Engineering and Technology
Modelware approach S • Convert and transform LS LS ::= S { “;” S } S ::= “stat” source CF target list: LS s: S s: S s: S stat; stat; stat / Software Engineering and Technology
Modelware approach LS S S • Convert and transform LS LS ::= S { “;” S } S ::= “stat” source CF target list: LS T2M M2M list: LS s: S s: S s: S stat; stat; stat s: S s: S s: S / Software Engineering and Technology
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> • Textual fragments use names, XMI uses Identifiers Class2Id[(A, _id1), …] Attribute2Id[(A, a, _id2, _id3), …] Operation2Id[A, n, _id4), …] / Software Engineering and Technology
Grammarware approach T( A “:=” B ) → <effect xsi:type = “slco:AssignmentStatement”/> T(B) T(A) </effect> T( “false” ) → <expression xsi:type=“slco:BooleanConstantExpression” value=“false”/> / Software Engineering and Technology
Two implementations • Modelware • Xpand for T2M • Xtext for M2T • Xtend for M2M All 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 / Software Engineering and Technology
Case study / Software Engineering and Technology
Case study / Software Engineering and Technology
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 / Software Engineering and Technology
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” / Software Engineering and Technology
Conclusions • Embedding grammar-based languages in metamodel-based languages • Two approaches • Modelware • Grammarware • Two implementations • Case study: textual alternative for UML activity diagrams / Software Engineering and Technology
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 / Software Engineering and Technology