Mahsa - Department of Computer Science
Transcription
Mahsa - Department of Computer Science
Feature-Based Survey of Model Transformation Approaches Krzysztof Czarnecki and Simon Helsen in IBM Systems Journal, 2006 Mahsa Hasani Sadi Department of Computer Science University of Toronto mhsadi@cs.toronto.edu CS2125: Modeling Methods Tools and Techniques, Fall 2012 Instructor: Marsha Chechik Background (1) (2002) A Request for Proposal on Query / View / Transformation Research Question: How to design a model transformation approach? 2 of 29 Background (2) Frameworks Languages Tools Methods Tefkat MT MOLA UMLX VIATRA GReAT Kent 3 of 29 YATL AMW ATL Kermeta BOTL AToM AGG Outline of the Paper Specification of the features of model transformation approaches Mandatory Features The outline of presentation: Optional Features Clonable Features Studying a set of the design concerns (features) of Features a model transformation xor-group language through examples or-group Features Classification of model transformation approaches 4 4 of 29 Krzysztof Czarnecki ECE Department University of Waterloo Features of Model Transformation Model Transformation Specification Tracing Transformation Rules Directionality Incrementality Rule Application Control Rule Organization 5 5 of 29 Source – Target Relationship Example: Transforming Class Diagrams to Relational Tables (1) 6 6 of 29 Example: Transforming Class Diagrams to Relational Tables (2) Instances also matter! 7 7 of 29 Specification Feature (1) transformation umlRdbms (uml : SimpleUML, rdbms : SimpleRDBMS) { relation PackageToSchema /* map each package to a schema */ { domain uml p:Package {name=pn} domain rdbms s:Schema {name=pn} } Not Executable (Declarative Language) } 8 8 of 29 Specification Feature (2) transformation Uml2Rdbms ( in uml:UML , out rdbms:RDBMS ) { // the entry point for the execution of the transformation main() { uml.objectsOfType(Package) -> map packageToSchema(); } …. } 9 9 of 29 Directly Executable (Imperative Language) Model Transformation Language Design Concerns transformation umlRdbms (uml : SimpleUML, rdbms : SimpleRDBMS) { relation PackageToSchema /* map each package to a schema */ { domain uml p:Package {name=pn} domain rdbms s:Schema {name=pn} Language Paradigm } } ObjectOriented Logic transformation Uml2Rdbms ( in uml:UML , out rdbms:RDBMS ) { // the entry point for the execution of the transformation main() Functional { uml.objectsOfType(Package) -> map packageToSchema(); } …. } 10 10 of 29 Procedural Supported Syntax Syntax Concrete Textual transformation Uml2Rdbms ( in uml:UML , out rdbms:RDBMS ) { // the entry point for the execution of the transformation main() { uml.objectsOfType(Package) -> map packageToSchema(); } …. } 11 11 of 29 Graphical Transformation Rules Feature (1) relation ClassToTable /* map each persistent class to a table */ { domain uml c:Class { namespace = p:Package {}, kind='Persistent', name=cn } domain rdbms t:Table { schema = s:Schema {}, name=cn} when { PackageToSchema(p, s); Application Conditions } where { Post AttributeToColumn(c, t); Conditions } } 12 12 of 29 Transformation Rules Feature (2) transformation umlRdbms (uml : SimpleUML, rdbms : SimpleRDBMS ) { top relation PackageToSchema {…} top relation ClassToTable {…} relation AttributeToColumn {…} Pre Conditions } 13 13 of 29 Transformation Rules Design Concerns Static Mode relation PackageToSchema /* map each package to a schema */ { Dynamic Mode Restriction } enforce domain uml p:Package {name=pn} In In / Out checkonly domain rdbms s:Schema {name=pn} In-Place Transformation Out } relation PackageToSchema /* map each package to a schema */ { Directionality } enforce domain uml p:Package {name=pn} enforce domain rdbms s:Schema {name=pn} Unidirectional } 14 14 of 29 Multidirectional Source – Target Relationship Feature Source – Target Relationship Existing Target New Target Update Destructive 15 15 of 29 In-Place Extension Only Tracing relation ClassToTable { enforce domain uml c:Class {namespace=p:Package {}, kind='Persistent', name=cn} enforce domain rdbms t:Table {schema=s:Schema {}, name=cn} } class TClassToTable { c: Class; p: Package; t: Table; s: Schema; } 16 16 of 29 Tracing Feature Tracing Dedicated Support Storage location Creation Manual Model Automatic Source 17 17 of 29 Separate Target Incrementality Feature Incrementality TargetIncrementality 18 18 of 29 SourceIncrementality Preservation of User Edits in Target Pattern Matching Feature Pattern Pattern Type = { { e1: <classname1>, e2: <classname2> …. en:<classnameN> L1 : <assoc1> (ei, ej) …. Lm: <assocM>(eu, ew) where <predicate> } Instances c1: Class, a1: Attribute L1: attrs (c1, a1) where c1.name = X and <object>.<property> = <variable> <object>.<property> = <expression> 19 19 of 29 a1.name = X + Y } Patterns Feature Transformation Rules Domain Body Patterns Variables Syntax Structure Abstract Strings Terms Concrete Graphs Textual 20 20 of 29 Graphical Composing Transformation Rule Organization library MyUmlFacilities(UML); …….. transformation Uml2Rdbms (in uml:UML, out rdbms:RDBMS) extends BasicUml2Rdbms, -- extending a transformation extends library UMLUtilities(UML) -- extending a library access library MathLibrary; -- accessing a math library …….. Modularity Mechanisms Reuse Mechanisms Inheritance 21 21 of 29 Logical Composition Parallel Transformations var tr1 := new Req2Pimgui(req, pimGui); var tr2 := new Req2Pimbehavior(req, pimBehavior); var st1 := tr1.parallelTransform(); // forks the PIM GUI transformation var st2 := tr2.parallelTransform(); // forks the PIM Behavior transformation this.wait(Set{st1,st2}); // waits patiently if (st1.succeeded() and st2.succeeded()) // creates the executable model new Pim2Psm(pimGui,pimBehavior,psm).transform(); 22 22 of 29 Rule Application Control Feature Rule Application Control Scheduling RuleSelection NonDeterminism 23 23 of 29 Explicit Condition Conflict Resolution Phasing Interactive Categorization of Model Transformation Approaches Model to Text Model to Model 24 24 of 29 Model to Text Approaches Visitor-Based Template-Based 25 25 of 29 Model-to-Model Approaches Direct Manipulation Structure-Driven Operational Relational Template-Based Graph-Transformation-Based Hybrid 26 26 of 29 Comments (1) Cited by 536 (publication year: 2006) Revised version of another paper of the same authors, “Classification of Model Transformation Approaches”, in OOPSLA 2003. Cited by 732 Setting the foundation for “Meta Object Facility (MOF) 2.0, Query/ View/ Transformation Specification”, latest version: January 2011, http://www.omg.org/spec/QVT 27 27 of 29 Evaluation of the paper A Well-written journal paper????????!!!!!!!!!!!!!!!!!!!!!!!! A journal paper????????!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! Novelty ????????!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! Significance of contributions??!! Cited by 536 28 28 of 29 Discussion Why a separate language for model-transformation? What types of model transformations does the language support? (Does it make any difference?) Structural model to structural model? Behavioral model to behavioral model? 29 Example: class to table ? Example: state diagram to petri nets? Structural model to behavioral model / vice versa? 29 of 29