X perf =1.00 X loss =0.01 SDSoftware Design and Quality A Declarative Language for Bidirectional Model Consistency Master’s Thesis of Dominik Werle at the Department of Informatics Institute for Program Structures and Data Organization (IPD) Reviewer: Prof. Dr. Ralf H. Reussner Second reviewer: Jun.-Prof. Dr.-Ing. Anne Koziolek Advisor: Dipl.-Inform. Max E. Kramer Second advisor: M.Sc. Michael Langhammer 09. October 2015 – 08. April 2016 Karlsruher Institut für Technologie Fakultät für Informatik Postfach 6980 76128 Karlsruhe I declare that I have developed and written the enclosed thesis completely by myself, and have not used sources or means without declaration in the text. Karlsruhe, 08. April 2016 .................................... (Dominik Werle) Abstract In model-driven engineering, the system under development is described and analyzed using models. Dierent models provide dierent abstractions of the system for dierent purposes. If multiple modeling languages are used, their models can contain overlapping informa- tion about the system. Then, they can become inconsistent after changes and need to be synchronized. The complexity of synchronizing models can be reduced by specifying consistency relationships in specialized languages and by automating the synchronization based on this specication. The languages can hide complexity that is not specic to the domain of the modeling languages, for example by deriving the operations needed for propagating changes from a model to another model for all pairs of models instead of requiring explicit specication for each pair and direction. In the course of this thesis, we designed the mapping language for specifying these consistency relationships and implemented a framework that maintains consistency based on the specication. The mapping language allows the specication of patterns in two related modeling languages, and constraints on the relationship of the patterns. Imperative Java code is generated from the specication and executed in case of a change to a model to reestablish consistency with associated models. This is done by creating or deleting corresponding structures and by propagating attribute values between the models. To allow a distinction from other approaches, we provide a comparison to state of the art transformation languages. i Zusammenfassung In der modellgetriebenen Softwareentwicklung wird das zu entwickelnde System mit Hilfe von Modellen beschrieben und analysiert. Verschiedene Modelle bieten unterschiedliche Abstraktionen des Systems für unterschiedliche Aufgaben. Falls mehrere Modellierungssprachen benutzt werden, können ihre Modelle überlappen- de Informationen über das System enthalten. Ist dies der Fall, können sie nach Änderungen inkonsistent werden und müssen synchronisiert werden. Die Komplexität des Modellsynchronisierens kann reduziert werden, indem spezialisierte Sprachen verwendet werden, um Konsistenzbeziehungen zu beschreiben, die als Grundlage für eine automatisierte Synchronisierung benutzt werden können. Die Sprachen verstecken Komplexität, die nicht für die Domäne der Modellierungssprachen spezisch ist, zum Beispiel, indem Operationen für die Übertragung von Änderungen in einem Modell auf ein anderes Modell für jedes Paar von Modellen abgeleitet werden, anstatt eine explizite Spezikation pro Paar und Richtung zu erfordern. In dieser Arbeit haben wir die Mapping-Sprache, mit der diese Konsistenzbeziehungen speziziert werden können, und ein Rahmenwerk, das basierend auf der Spezikation Konsistenz aufrechterhält, entwickelt. Die Mapping-Sprache erlaubt das Beschreiben von Mustern in zwei in Beziehung ste- henden Modellierungssprachen und von Randbedingungen, die für zwei aufeinander abgebildete Muster gelten müssen. Aus der Beschreibung wird imperativer Java-Quelltext generiert, der im Fall einer Änderung eines Modells ausgeführt wird, um die Konsistenz mit anderen Modellen wiederherzustellen. Hierfür werden korrespondierende Strukturen in den Modellen erzeugt oder gelöscht und Attributwerte zwischen den Modellen übertragen. Um eine Abgrenzung und Einordnung gegenüber verwandten Ansätzen zu erlauben, vergleichen wir unseren Ansatz mit modernen Transformationssprachen. iii Contents Abstract i Zusammenfassung iii 1 Introduction 1 1.1 Motivation . .1 1.1.1 Models as Abstractions . .1 1.1.2 Relationship of Dierent Models . .2 1.1.3 Resolution of Inconsistencies . .3 1.1.4 The Mapping Language . .3 1.2 Goals . .4 1.3 Structure . .4 1.4 Notation . .5 2 Foundations 7 2.1 Model-Driven Engineering . .7 2.2 Models, Meta Models and Languages . .8 2.3 Domain-Specic Languages . .8 2.4 Model Transformations . .9 2.4.1 Model Transformation Languages and Problems . .9 2.4.2 Declarative and Imperative Programming Languages . 10 2.4.3 Model Transformation Properties . 10 2.4.4 Dierent Execution Modes of Model Transformations . 11 2.4.5 Consistency Preservers . 12 2.4.6 Witness Structure . 13 2.4.7 Triple Graph Grammars . 13 2.5 The Eclipse Modeling Framework . 14 2.6 Xtext Language Engineering Framework . 15 2.6.1 Xtext . 15 2.6.2 Xbase . 15 2.6.3 Xtend . 16 2.7 View-Centric Model-Driven Engineering and Vitruvius ......... 16 2.7.1 Problems with Heterogeneous Models . 16 2.7.2 Orthographic Software Modeling . 16 2.7.3 Vitruvius .............................. 16 2.8 Roles in the Model-Driven Engineering Process . 18 v Contents 3 Aspects of Consistency Preservation 19 3.1 Surveys on Model Transformation . 19 3.2 Basic Denitions . 20 3.2.1 Meta Model . 20 3.2.2 Consistency Relation . 20 3.2.3 Consistency Transformation . 20 3.3 Characterization of the Meta Models . 20 3.3.1 Heterogeneous Representation of Information . 21 3.3.2 Heterogeneous Meta Model Design . 21 3.3.3 Derived Meta Models . 22 3.3.4 Validity . 22 3.3.5 Scope . 22 3.4 Characterization of the Relation . 22 3.4.1 Bijectivity and Left- and Right-Totality . 23 3.4.2 Validity and Scope . 23 3.4.3 Additional Information . 24 3.4.4 N-ary Consistency Relations . 24 3.5 Specication of the Relation . 25 3.5.1 Relating Substructures . 25 3.5.2 Graph Patterns . 26 3.5.3 Meta Level of Pattern Description . 26 3.5.4 Mapping of Patterns . 27 3.5.5 Mapping of Attribute Values . 27 3.6 Characterization of the Transformation . 29 3.6.1 Dedicated Target Model . 29 3.6.2 Validity and Scope . 29 3.6.3 User Interaction . 30 3.7 Specication of the Transformation . 30 3.7.1 Constraint Solving . 30 3.7.2 Deriving Imperative Code . 30 3.7.3 Consistency of Transformation Parts . 31 3.7.4 Well-Behavedness of Attribute Propagation . 32 3.8 Characterization of Multiple Transformation Steps . 33 3.8.1 Size of Deltas . 33 3.8.2 Caching of Information . 33 3.8.3 Oscillations . 35 3.8.4 Undoability . 35 3.9 Consistency Specication in the Model-Driven Engineering Process . 36 3.9.1 Model Transformation and Meta Model Co-Evolution . 36 3.9.2 Manual and Automated Consistency Preservation . 37 3.9.3 Partial and Comprehensive Automated Consistency Preservation 37 3.9.4 Recognizing Uncertainties through Inconsistencies . 38 vi Contents 4 The Mapping Language 41 4.1 Two Introductory Examples . 41 4.1.1 Simple One-to-One Mapping . 41 4.1.2 Nested Mapping and Conditions . 42 4.2 The MIR Language Family . 45 4.2.1 Parts of the MIR Language Family . 45 4.2.2 The Mapping Language . 45 4.3 Language Features . 47 4.3.1 Syntax . 47 4.3.2 Semantics . 49 4.3.3 Default Mappings . 50 4.4 Design of the Mapping Language . 51 4.4.1 Language Classication . 51 4.4.2 Mappings for Single Meta Classes . 51 4.4.3 Mappings for Model Element Structures . 52 4.4.4 Mappings of Structures and Values . 53 4.4.5 Default Containment . 54 4.5 Possible Extensions . 58 4.5.1 Rule Composition and User Interaction . 58 4.5.2 Inheritance in Signatures . 58 4.5.3 Class Hierarchy, Enumerables and Stereotypes . 59 4.5.4 Reusable Mapping Functions . 60 4.5.5 Complex Attribute Relations . 60 4.5.6 Transitive Closure and Dynamic Structures . 61 4.6 Limitations and Future Work . 62 4.6.1 Language Expressiveness . 62 4.6.2 Consistency Requirements . 64 4.6.3 Batch Mode and Model Integration . 64 4.6.4 Pattern Matching and Change-Drivenness . 65 4.6.5 Validation of Mapping Specications . 65 4.6.6 The Mapping Language and the MIR Language Family . 66 5 Implementation 67 5.1 Vitruvius ................................... 67 5.1.1 Correspondences . 67 5.1.2 Temporary Unique Identiers . 68 5.1.3 Change Meta Model . 68 5.1.4 Virtual Single Underlying Model . 69 5.1.5 Model Synchronization Process . 69 5.2 Change Synchronization for Mappings . 70 5.3 Code Generation . 75 5.3.1 Generated Entities . 75 5.3.2 Types and Names in the Generated Code . 80 5.3.3 Mapping Language Code Generator . 80 5.3.4 Constraint Language Code Generator . 81 vii Contents 5.4 Language Implementation . 83 5.4.1 Editor . 83.
Details
-
File Typepdf
-
Upload Time-
-
Content LanguagesEnglish
-
Upload UserAnonymous/Not logged-in
-
File Pages143 Page
-
File Size-