“ Model-Driven Development of Model Transformations” Pieter Van Gorp Proefschrift ingediend tot het behalen van de graad van Doctor in de Wetenschappen
Model Everything The System  (part of the real world) Model of the  external structure Model of the  internal structure Model of the  electricity models models models Omit details Support a purpose
Language Evolution in Software Development Java 1 CORBA BPEL.XML EJB JMS, JCA, WSIF, … CORBA CORBA BPEL.XML BPEL.XML VB C++ VB.NET C# Bla 1 Bla 3 Bla 2 The next best thing The next best thing The next best thing ? ? ?
Escaping from Language evolution & extinction? 1954 - FORTRAN  1958 - LISP  1958 - ALGOL 58  1959 - COBOL  1962 - APL  1962 - Simula  1964 - BASIC  1964 - PL/I  1970 - Pascal  1970 - Forth  1972 - C  1972 - Smalltalk  1972 - Prolog  1973 - ML  1978 - SQL  1983 - Ada  1983 - C++  1985 - Eiffel  1987 - Perl  1989 - FL (Backus)  1990 - Haskell  1990 - Python  1991 - Java  1993 - Ruby  1995 - PHP  2000 - C#  … Java RMI JDBC JMS EJB 1 Hibernate EJB 2 Generics … OO Modeling  UML DataSets NHibernate ODX Gentle.NET Ubik Persist.NET ... Keep it stable “ Human Friendly”
Modeling Language :  Keep it Stable specify UML conforms- to conforms- to conforms- to Java C++ Programmer interpret specify specify…
Modeling Languages & Tools :   Human Friendly Example: Decompose complex models into  Views Association View Inheritance View Any other task-specific view Always keep track of the big picture Automatic Consistency Maintenance Mainstream: several industrial tools models
One Step Further: Multiple Software Models, Multiple Levels of Abstraction Purpose of  Analysis model :  conceptual data modeling Purpose of  Design model :  Choosing datatypes (linkedlist etc.) Optimizing performance    (bidirectional references or not...) Evaluating architecture (MVC, ...) Clean separation between models    iterative development
Transformations in Conventional Software Development Drawbacks Manual!
Doing the transformations by hand is  expensive  and  error-prone ! If only we could automatically   transform those models into whatever the machine  requires! Anno 2000 ... and we do them over and over  for each project ...
Transformations in Model-Driven Software Development Rien ne se perd, rien ne se crée,  tout se transforme!
Thesis Goals Model  the  Model Transformations   Evaluate the UML Reuse expertise from the  Application  Modeling Specialize for  Transformation  modeling Similar to specializing UML for  specific application domains  (BPM, DM, ...) State-of-the-art  Start Taxonomy: compare existing approaches, identify weaknesses Graph Transformation Languages Improve BUT: Maintain UML’s interoperability General Applicability:  Refactoring,  Synthesis,  Synchronization Derive   Implementation  Automatically :  Translate the Transformation Models automatically into an implementation Model-Driven Development of Model Transformations
Principles of Translation conforms-to conforms-to conforms-to Hieroglyphic models Demotic Ancient Greek models ... models describing the repealing of various taxes and instructions to erect statues in temples  describing the repealing of various taxes and instructions to erect statues in temples  describing the repealing of various taxes and instructions to erect statues in temples
Principles of Translation Hieroglyphic models Demotic models Thomas Young (1818):  Demotic Alphabet Translation to Ancient Greek Jean-François Champollion (1824):  Hieroglyphic Alphabet  & Grammar Translation Rules to Demotic Alphabet, Grammar, Normalization, Translation Rules Need to describe:  Structure of Demotic & Hieroglyphic languages Translation process a  “Metamodel”  =  a Model of a Language Translation Process = Application of  Transformations Noun,  Verb, ... Substantif, Verbe, ...
Translation LV PV O PV O LV Normalization “ Switch position of Subject and Verb” Translation “ LV PV O maps to …”` Translation “ LV PV O maps to …” UML2CSP :  first normalize,  then translate!
A language for Modeling Translations... Metamodel Structural  model of the translation program Model of the input/output  Languages The language in which the input models are expressed Can be model of UML, BPML,  YourOwnThing , ... Mainstream syntax: UML  (MOF)   Class Diagrams   Standardized Translation Rules Behavioral  model of the translation program Magnitude of new languages... Needs standardization ... Without re-inventing the wheel! >> Align with (1) >> Link to Class Diagrams
Standard Syntax for Metamodeling Example: UML Metamodel UML  Meta Model (of UML) UML Model  (of racing game)
Standard Syntax for Metamodeling Example: UML Metamodel UML  Meta Model (of UML) UML Model  (of racing game)
Standard Syntax for Metamodeling Example: UML Metamodel UML  Meta Model (of UML) UML Model  (of racing game)
A language for Modeling Translations... Metamodel Structural  model of the translation program Model of the input/output  Languages The language in which the input models are expressed Can be model of UML, BPML,  YourOwnThing , ... Mainstream syntax:  Class Diagrams   = Object-Oriented Structural Modeling Standardized Translation Rules Behavioral  model of the translation program Magnitude of new languages... Needs standardization ... Without re-inventing the wheel! EXISTING N E W
Related Software Models:  Correspondences in Detail Analysis Model Design Model
Modeling Transformation Rules INPUT model OUTPUT model INPUT metamodel OUTPUT metamodel Match, Create, Destroy,  Copy in terms of the  metamodels Class Diagrams too! Class Diagrams conforms to conforms to Copying  fragments of models is complex! » Example
IN/OUT metamodel conforms to conforms to OUTPUT model INPUT model processed by processed by IN-to-OUT   Transformation read write Modeling a  Copy  Operation Derivation
Modeling a  Copy  Operation Derivation IN/OUT metamodel OUTPUT model INPUT model <<copy>> IN-to-OUT   Transformation read write
Modeling a  Copy  Operation Summary Transformation Modeling Language:  (extension of) so-called “ Story Diagrams” , in  Standard UML  syntax
Cognitive Evaluation  (of Transformation Modeling Language) + T. R. G. Green.  Cognitive dimensions of notations . In Alistair Sutcliffe and Linda Macaulay, editors,  People and Computers V, pages 443–460, New York, NY, USA,1989. Cambridge University Press. Consistency (able to infer <<onCopy>> <<destroy>>) Diffuseness  (however: issue of input/output metamodels!) Secondary Notation (2D layout, color, …) Progressive Evaluation (tool issue?) Role-Expressiveness (edges: relation to whole) Juxtaposition (embedding… native Fujaba) Closeness of Mapping (syntax ~ metamodeling) -
Generality   ( of Transformation Modeling Language) Synthesis Refactoring Synthesis Refactoring UML2CSP CM2RM Copy2GT Pull Up Method Extract Interface Push Down Method Model Synchronization Model Synchronization Operational Declarative, Hybrid: >> outline for    future work Normalization Normalization UML2CSP Chaining Chaining UML2CSP
Thesis Goals Model  the  Model Transformations   Evaluate the UML Reuse expertise from the  Application  Modeling Specialize for  Transformation  modeling Similar to specializing UML for  specific application domains  (BPM, DM, ...) State-of-the-art  Start Taxonomy: compare existing approaches, identify weaknesses Graph Transformation Languages Improve BUT: Maintain UML’s interoperability General Applicability:  Refactoring,  Synthesis,  Synchronization Derive   Implementation  Automatically :  Translate the Transformation Models automatically into an implementation Model-Driven Development of Model Transformations
Towards Transformation Code… Higher Order Transformations Case Studies: Story Diagrams Copying
From  Story Diagrams  to JMI  Transformation Code From the  Copy  language to plain  Story Diagrams Higher Order Transformations ModelTransformer.ftl TransFlow.ftl TransPrimitive.ftl <<success>>,  <<failure>>,  <<each time>> <<success>>,  <<failure>>,  <<each time>> <<create>>, <<destroy>> <<copy>> , <<create>>, <<destroy>> <<success>>,  <<failure>>,  <<each time>> <<create>>, <<destroy>> Again as Story Diagrams! Eat your own dogfood JMI, EMF, Java2, ... getClasses(): FCollection remove(), add(LinkedList l), … MDA Standardization of the state-of-the-art (Fujaba 3) Improvement  of the state-of-the-art (Graph Transformation, QVT) Independent of the  modeling platform!
Conclusions Modeling  of  Model Transformations   Evaluation of UML Class & Activity diagrams sufficient for challenging transformation problems Most popular diagram types! Profiles are good for language prototyping State-of-the-art  Start Taxonomy: compare existing approaches, identify weaknesses Graph Transformation Language (Story Diagrams) Standardize Interoperability (UML, XMI, JMI, MOF) Views on Transformation Models Improve Copy Operator Maintain interoperability: language  extensions  should be considered more! General Applicability:  Refactoring,  Synthesis,  Synchronization Transformation  of  Model Transformations Final Conclusion Transformations do  not  require fundamentally different modeling techniques! Model & Transform Everything... but leverage mature languages and tools! Future Work Hybrid Modeling Languages  Scheduling, Directionality, Change Propagation, Versatility Control flow Model-Driven Development of Model Transformations

Model-driven Development of Model Transformations

  • 1.
    “ Model-Driven Developmentof Model Transformations” Pieter Van Gorp Proefschrift ingediend tot het behalen van de graad van Doctor in de Wetenschappen
  • 2.
    Model Everything TheSystem (part of the real world) Model of the external structure Model of the internal structure Model of the electricity models models models Omit details Support a purpose
  • 3.
    Language Evolution inSoftware Development Java 1 CORBA BPEL.XML EJB JMS, JCA, WSIF, … CORBA CORBA BPEL.XML BPEL.XML VB C++ VB.NET C# Bla 1 Bla 3 Bla 2 The next best thing The next best thing The next best thing ? ? ?
  • 4.
    Escaping from Languageevolution & extinction? 1954 - FORTRAN 1958 - LISP 1958 - ALGOL 58 1959 - COBOL 1962 - APL 1962 - Simula 1964 - BASIC 1964 - PL/I 1970 - Pascal 1970 - Forth 1972 - C 1972 - Smalltalk 1972 - Prolog 1973 - ML 1978 - SQL 1983 - Ada 1983 - C++ 1985 - Eiffel 1987 - Perl 1989 - FL (Backus) 1990 - Haskell 1990 - Python 1991 - Java 1993 - Ruby 1995 - PHP 2000 - C# … Java RMI JDBC JMS EJB 1 Hibernate EJB 2 Generics … OO Modeling UML DataSets NHibernate ODX Gentle.NET Ubik Persist.NET ... Keep it stable “ Human Friendly”
  • 5.
    Modeling Language : Keep it Stable specify UML conforms- to conforms- to conforms- to Java C++ Programmer interpret specify specify…
  • 6.
    Modeling Languages &Tools : Human Friendly Example: Decompose complex models into Views Association View Inheritance View Any other task-specific view Always keep track of the big picture Automatic Consistency Maintenance Mainstream: several industrial tools models
  • 7.
    One Step Further:Multiple Software Models, Multiple Levels of Abstraction Purpose of Analysis model : conceptual data modeling Purpose of Design model : Choosing datatypes (linkedlist etc.) Optimizing performance (bidirectional references or not...) Evaluating architecture (MVC, ...) Clean separation between models  iterative development
  • 8.
    Transformations in ConventionalSoftware Development Drawbacks Manual!
  • 9.
    Doing the transformationsby hand is expensive and error-prone ! If only we could automatically transform those models into whatever the machine requires! Anno 2000 ... and we do them over and over for each project ...
  • 10.
    Transformations in Model-DrivenSoftware Development Rien ne se perd, rien ne se crée, tout se transforme!
  • 11.
    Thesis Goals Model the Model Transformations Evaluate the UML Reuse expertise from the Application Modeling Specialize for Transformation modeling Similar to specializing UML for specific application domains (BPM, DM, ...) State-of-the-art Start Taxonomy: compare existing approaches, identify weaknesses Graph Transformation Languages Improve BUT: Maintain UML’s interoperability General Applicability: Refactoring, Synthesis, Synchronization Derive Implementation Automatically : Translate the Transformation Models automatically into an implementation Model-Driven Development of Model Transformations
  • 12.
    Principles of Translationconforms-to conforms-to conforms-to Hieroglyphic models Demotic Ancient Greek models ... models describing the repealing of various taxes and instructions to erect statues in temples describing the repealing of various taxes and instructions to erect statues in temples describing the repealing of various taxes and instructions to erect statues in temples
  • 13.
    Principles of TranslationHieroglyphic models Demotic models Thomas Young (1818): Demotic Alphabet Translation to Ancient Greek Jean-François Champollion (1824): Hieroglyphic Alphabet & Grammar Translation Rules to Demotic Alphabet, Grammar, Normalization, Translation Rules Need to describe: Structure of Demotic & Hieroglyphic languages Translation process a “Metamodel” = a Model of a Language Translation Process = Application of Transformations Noun, Verb, ... Substantif, Verbe, ...
  • 14.
    Translation LV PVO PV O LV Normalization “ Switch position of Subject and Verb” Translation “ LV PV O maps to …”` Translation “ LV PV O maps to …” UML2CSP : first normalize, then translate!
  • 15.
    A language forModeling Translations... Metamodel Structural model of the translation program Model of the input/output Languages The language in which the input models are expressed Can be model of UML, BPML, YourOwnThing , ... Mainstream syntax: UML (MOF) Class Diagrams Standardized Translation Rules Behavioral model of the translation program Magnitude of new languages... Needs standardization ... Without re-inventing the wheel! >> Align with (1) >> Link to Class Diagrams
  • 16.
    Standard Syntax forMetamodeling Example: UML Metamodel UML Meta Model (of UML) UML Model (of racing game)
  • 17.
    Standard Syntax forMetamodeling Example: UML Metamodel UML Meta Model (of UML) UML Model (of racing game)
  • 18.
    Standard Syntax forMetamodeling Example: UML Metamodel UML Meta Model (of UML) UML Model (of racing game)
  • 19.
    A language forModeling Translations... Metamodel Structural model of the translation program Model of the input/output Languages The language in which the input models are expressed Can be model of UML, BPML, YourOwnThing , ... Mainstream syntax: Class Diagrams = Object-Oriented Structural Modeling Standardized Translation Rules Behavioral model of the translation program Magnitude of new languages... Needs standardization ... Without re-inventing the wheel! EXISTING N E W
  • 20.
    Related Software Models: Correspondences in Detail Analysis Model Design Model
  • 21.
    Modeling Transformation RulesINPUT model OUTPUT model INPUT metamodel OUTPUT metamodel Match, Create, Destroy, Copy in terms of the metamodels Class Diagrams too! Class Diagrams conforms to conforms to Copying fragments of models is complex! » Example
  • 22.
    IN/OUT metamodel conformsto conforms to OUTPUT model INPUT model processed by processed by IN-to-OUT Transformation read write Modeling a Copy Operation Derivation
  • 23.
    Modeling a Copy Operation Derivation IN/OUT metamodel OUTPUT model INPUT model <<copy>> IN-to-OUT Transformation read write
  • 24.
    Modeling a Copy Operation Summary Transformation Modeling Language: (extension of) so-called “ Story Diagrams” , in Standard UML syntax
  • 25.
    Cognitive Evaluation (of Transformation Modeling Language) + T. R. G. Green. Cognitive dimensions of notations . In Alistair Sutcliffe and Linda Macaulay, editors, People and Computers V, pages 443–460, New York, NY, USA,1989. Cambridge University Press. Consistency (able to infer <<onCopy>> <<destroy>>) Diffuseness (however: issue of input/output metamodels!) Secondary Notation (2D layout, color, …) Progressive Evaluation (tool issue?) Role-Expressiveness (edges: relation to whole) Juxtaposition (embedding… native Fujaba) Closeness of Mapping (syntax ~ metamodeling) -
  • 26.
    Generality ( of Transformation Modeling Language) Synthesis Refactoring Synthesis Refactoring UML2CSP CM2RM Copy2GT Pull Up Method Extract Interface Push Down Method Model Synchronization Model Synchronization Operational Declarative, Hybrid: >> outline for future work Normalization Normalization UML2CSP Chaining Chaining UML2CSP
  • 27.
    Thesis Goals Model the Model Transformations Evaluate the UML Reuse expertise from the Application Modeling Specialize for Transformation modeling Similar to specializing UML for specific application domains (BPM, DM, ...) State-of-the-art Start Taxonomy: compare existing approaches, identify weaknesses Graph Transformation Languages Improve BUT: Maintain UML’s interoperability General Applicability: Refactoring, Synthesis, Synchronization Derive Implementation Automatically : Translate the Transformation Models automatically into an implementation Model-Driven Development of Model Transformations
  • 28.
    Towards Transformation Code…Higher Order Transformations Case Studies: Story Diagrams Copying
  • 29.
    From StoryDiagrams to JMI Transformation Code From the Copy language to plain Story Diagrams Higher Order Transformations ModelTransformer.ftl TransFlow.ftl TransPrimitive.ftl <<success>>, <<failure>>, <<each time>> <<success>>, <<failure>>, <<each time>> <<create>>, <<destroy>> <<copy>> , <<create>>, <<destroy>> <<success>>, <<failure>>, <<each time>> <<create>>, <<destroy>> Again as Story Diagrams! Eat your own dogfood JMI, EMF, Java2, ... getClasses(): FCollection remove(), add(LinkedList l), … MDA Standardization of the state-of-the-art (Fujaba 3) Improvement of the state-of-the-art (Graph Transformation, QVT) Independent of the modeling platform!
  • 30.
    Conclusions Modeling of Model Transformations Evaluation of UML Class & Activity diagrams sufficient for challenging transformation problems Most popular diagram types! Profiles are good for language prototyping State-of-the-art Start Taxonomy: compare existing approaches, identify weaknesses Graph Transformation Language (Story Diagrams) Standardize Interoperability (UML, XMI, JMI, MOF) Views on Transformation Models Improve Copy Operator Maintain interoperability: language extensions should be considered more! General Applicability: Refactoring, Synthesis, Synchronization Transformation of Model Transformations Final Conclusion Transformations do not require fundamentally different modeling techniques! Model & Transform Everything... but leverage mature languages and tools! Future Work Hybrid Modeling Languages Scheduling, Directionality, Change Propagation, Versatility Control flow Model-Driven Development of Model Transformations