Reflective Model Driven Engineering with The
Total Page:16
File Type:pdf, Size:1020Kb
Model-Driven Development of Model Transformations Citation for published version (APA): van Gorp, P. M. E. (2008). Model-Driven Development of Model Transformations. Universiteit van Antwerpen. Document status and date: Published: 01/01/2008 Document Version: Publisher’s PDF, also known as Version of Record (includes final page, issue and volume numbers) Please check the document version of this publication: • A submitted manuscript is the version of the article upon submission and before peer-review. There can be important differences between the submitted version and the official published version of record. People interested in the research are advised to contact the author for the final version of the publication, or visit the DOI to the publisher's website. • The final author version and the galley proof are versions of the publication after peer review. • The final published version features the final layout of the paper including the volume, issue and page numbers. Link to publication General rights Copyright and moral rights for the publications made accessible in the public portal are retained by the authors and/or other copyright owners and it is a condition of accessing publications that users recognise and abide by the legal requirements associated with these rights. • Users may download and print one copy of any publication from the public portal for the purpose of private study or research. • You may not further distribute the material or use it for any profit-making activity or commercial gain • You may freely distribute the URL identifying the publication in the public portal. If the publication is distributed under the terms of Article 25fa of the Dutch Copyright Act, indicated by the “Taverne” license above, please follow below link for the End User Agreement: www.tue.nl/taverne Take down policy If you believe that this document breaches copyright please contact us at: [email protected] providing details and we will investigate your claim. Download date: 10. Oct. 2021 Model-Driven Development of Model Transformations Pieter Van Gorp Promotor: Prof. dr. Dirk Janssens Co-promotor: Prof. dr. Serge Demeyer Proefschrift ingediend tot het behalen van de graad van Doctor in de Wetenschappen Acknowledgements The priceless support of many has resulted in the successful completion of this thesis. I am now able to hold this document and enjoy nice memories of five years of doctoral research. “Regrets, I’ve had a few; But then again, too few to mention.” [6] Therefore, it is a pleasure to thank the many people who supported this challenging project. I would like to thank my parents for giving me the motivation and resources to study at the university. Thanks to all my family members for always being there when I needed them the most. Thanks to Nena for supporting me in countless ways, in particular when I was completing this text. Thanks to Dirk Janssens and Serge Demeyer for supervising my doctoral research. You have given me the freedom to pursue my personal research interests, you have thaught me how to write scientific papers, you have enabled me to attend international conferences, you have recruited new team members in my research domain, and you have enabled me to align my teaching and research activities. Dirk, thanks for your insights related to graph transformation and thanks for introducing me to collaborative experts in the field. Serge, thanks for assisting me in finding a balance between theoretical and practical contributions. Special thanks to all office and research group comrades, in particular to Duboix, Skiptron and Method Man. You have have made my office time enjoyable for reasons that go beyond my research passion. Thanks to Hans Schippers and Olaf Muliawan for building the MoTMoT infrastructure. Hans, thanks for “playing” devil’s advocate so many times. I am very grateful to the hosts of my research visits. In particular, thanks to Reiko Heckel, Lothar Wendehals and Robert Wagner for the warm welcome in Paderborn. Thanks to Jean Bézivin and Frédéric Jouault for the great time in Nantes. Thanks to the organizers of the Dagstuhl seminars that I enjoyed attending. Thanks to Frank Altheide for visiting our lab and joining me on an exploration of the relations between new MDA technologies and more mature work in the domain of consistency maintenance. Frank, you have raised my awareness of things that I had been taking for granted while working in a rather closed community. I owe my interest in enterprise computing to Jan Broeckhove and Gunther Stuer. Thanks for pointing me in this challenging direction. Unfortunately, it is impossible to thank every- body who may have influenced me throughout inspiring discussions. However, I would like to express a special gesture of gratitude to Hans Stenten, Tom Mens, Andy Schürr, Albert Zündorf, Hans Vangheluwe, Krzysztof Czarnecki, Kim Mens, Roel Wuyts, Jean-Marie Favre, Jos Warmer, Colin Atkinson, Ralf Lämmel, James Skene, Alexey Cherchago, Simon Becker and Jordi Cabot. 3 Abstract This thesis presents how evolving software models expressed in different formalisms can be kept consistent by means of an object-oriented integration of metamodeling, design by con- tract and graph transformation. It incrementally builds upon existing modeling languages to illustrate that the adoption of the new model-driven engineering paradigm does not force organizations to abandon their investments in more mature technologies. More specifically, this thesis shows how the new transformation languages introduced by the Model Driven Architecture standardization effort relate to fragments of the UML that have a well-known, object-oriented semantics. The proposed techniques have emerged from several case studies that involve a wide vari- ety of transformation challenges. Therefore, the contributions are applicable for transforma- tion modeling in general: at first, it is illustrated how model evolution can be supported; sec- ondly, the technique is applied to transform conceptual models into more computer oriented ones; finally, the technique is applied and extended in the context of model synchronization. 5 Contents 1 Introduction 13 1.1 Context . 13 1.1.1 Model-Driven Engineering . 13 1.1.2 Standardization . 14 1.1.3 Summary of Contributions . 15 1.2 Model Driven Architecture . 16 1.2.1 The UML as a Framework for Domain Specific Visual Languages . 17 1.2.1.1 UML Profile Application . 17 1.2.1.2 Evaluation . 19 1.2.1.3 UML Profile Definition . 19 1.2.1.4 Language Support for Profiles . 20 1.2.2 Meta Object Facility (MOF) . 22 1.2.3 MOF Queries, Views and Transformations RFP . 22 1.2.3.1 Requirements from the Request For Proposals . 22 1.2.3.2 Evaluation of Existing Solution: Java Metadata Interface . 23 1.3 Towards Standards for Modeling Transformations . 24 1.3.1 Jézéquel’s OCL Actions . 24 1.3.2 Cariou’s OCL Transformation Contracts . 25 1.3.3 Akehurst’s OCL Relations . 26 1.3.3.1 Standardization of a Mapping Operator . 27 1.3.3.2 Pattern for Modeling Mathematical Relations in the UML . 28 1.3.4 Controlled Graph Transformation, Story Diagrams . 32 1.3.4.1 Graph Transformation Basics: Left- and Right-hand Sides . 33 1.3.4.2 Concrete Syntax: Merging LHS and RHS . 34 1.3.4.3 Control Structures . 36 1.3.4.4 Evaluation of the Story Driven Modeling Methodology . 37 1.3.5 MOF Queries, Views and Transformations Standard . 38 1.4 Summary and Outlook . 39 2 A Taxonomy of Model Transformation 41 2.1 The Taxonomy as an organic Community Artifact . 42 2.2 Classifying Transformation Types . 42 2.2.1 Transformation Types . 43 2.2.2 Taxonomy Elements . 44 2.2.2.1 Translation or Rephrasing . 44 6 CONTENTS 7 2.2.2.2 Horizontal or Vertical . 44 2.2.2.3 Syntactical or Semantical . 45 2.2.3 Classification . 45 2.3 Classifying Transformation Designs . 46 2.3.1 Number of (Sub-)Models and Metamodels . 46 2.3.1.1 First-class or Sub-model Transformation . 46 2.3.1.2 Input-destructive, Input-polluting or Input-preserving . 48 2.3.1.3 In-place or Out-place . 49 2.3.1.4 Endogenous or Exogenous . 49 2.3.1.5 Relation to Transformation Types . 50 2.3.2 Technical Space . 50 2.3.3 Intra- or Inter-Space . 51 2.3.4 Versatility: Enforceable, Checkable, Ignorable, Prioritizable . 52 2.4 Classifying Transformation Languages . 52 2.4.1 Declarative or Operational . 52 2.4.1.1 Change Propagation: Implicit, Explicit or Both . 53 2.4.1.2 Execution Direction: Implicit, Explicit or Both . 53 2.4.1.3 Rule Scheduling: Implicit, Explicit or Both . 55 2.4.1.4 Restrictive or Constructive . 56 2.4.2 Concrete Syntax . 57 2.4.3 Decomposition Mechanisms . 58 2.4.4 Genericity . 58 2.4.4.1 Specialization . 58 2.4.4.2 Overloading . 58 2.4.4.3 Reflection . 59 2.4.4.4 Higher Order Transformations . 59 2.4.5 Traceability . 59 2.5 Classifying Transformation Tools . 60 2.5.1 CRUD: Creating/Reading/Updating/Deleting transformations . 60 2.5.2 Useful and Usable . 60 2.5.3 Run-Time Performance versus Developer Performance . 61 2.5.4 Input/Output: In-Memory versus Serialized . 61 2.5.5 Standards . 61 2.6 Summary and Outlook . 62 I Refactoring 65 3 Towards Automating Source-Consistent UML Refactoring 67 3.1 Refactoring: Context, Tools, Relation to the UML . 68 3.2 Describing UML Refactorings as Refactoring Contracts . 68 3.2.1 Refactoring Contracts . 68 3.2.2 Extract Method . 69 3.2.2.1 OCL Pre- and Postconditions . 69 3.2.2.2 OCL Code Smell: Duplicate Code ............. 71 3.2.3 Pull Up Method . 72 3.2.4 Discussion .