Download presentation

Presentation is loading. Please wait.

Published byZachary Crabtree Modified over 2 years ago

1
A Model-based Development approach for Model Transformations Shekoufeh Kolahdouz Rahimi, Kevin Lano Shekoufeh.kolahdouzrahimi@kcl.ac.ukShekoufeh.kolahdouzrahimi@kcl.ac.uk, kevin.lano@kcl.ac.ukkevin.lano@kcl.ac.uk

2
Model Transformation Issues Specification of model transformations Development processes for model transformations UML-RSDS: A General Model-Driven Software Development Approach 2

3
Development Process for Model Transformations Requirements Abstract Specification Explicit Specification and Design Implementation 3

4
Tree to Graph Transformation 4 Transformation

5
Requirements check validity of the source model (no duplicate names, and no undefined parent trees) carry out the mapping upon a valid model Asm1: Asm2: 5

6
property of the tree metamodel properties of the graph metamodel Ens1: 6 Pres is a predicate in OCL over the source metamodel Ens is a predicate in OCL over the target metamodel Asm may in general be a predicate over both metamodels

7
Abstract specification C1 : For each tree node in the source model there is a graph node in the target model with the same name C2 : For each non-trivial parent relationship in the source model, there is an edge representing the relationship in the target model 7

8
C3 For each graph node in the target model there is a tree node in the source model with the same name C4 For each edge in the target model, there is a non-trivial parent relationship in the source model, which the edge represents C5 The same as Ens2 8 C3 and C4 are duals of C1 and C2 C1 and C3 together with the metamodels ensure that there is a 1-1 mapping from trees to nodes, which facilitates change propagation in both directions.

9
Cons should be sufficient to establish Ens: Cons should prove that Pres are preserved, via a suitable interpretation from the source language to the target language 9

10
Explicit specification and design Phase1 : Map all tree elements to corresponding nodes Its global specification is C1 and C3, its assumption is Asm 10 for t : Tree do mapTreeToNode(t)

11
Phase2: Map parent links to corresponding edges. the global specification C2 and C4 and C5, its assumption is C1 and C3 and 11 for t : Tree do mapTreeToEdge(t)

12
A ruleset in UML-RSDS is a set of rules (operations), it is defined as a UML class with a behaviour defined by an activity. This controls the allowed order of application of the rules. In this example we can therefore have one ruleset for each phase, each with a single operation. By composing the two phases in sequence, we can also establish the overall correctness of the transformation: 12

13
Implementation In this case a direct change-propagating implementation of Cons is possible, or Java code can be generated from the explicit activities and rules. 13

14
Case Study 2: Mapping activities from UML 1.4 to UML 2.2 14

15
Phase1: Establishes the correspondences between each kind of state vertex and activity node, ie, the axioms F1 to F11 and their inverses. Phase2: Establishes the correspondences of guards and transitions with opaque expressions and activity edges, assuming the correspondences of states from phase1. Phase3: Establishes the correspondences of partitions and activity graphs with activity partitions and activities, assuming the correspondences of states from phase1 and transitions from phase2. 15 The overall algorithm is specified as the composition of the three phases: activity1; activity2; activity3.

16
Case Study 3: UML to Relational Database mapping 16

17
phase1: replace each association class by two new associations. This establishes AssociationClass = {}. phase2: remove multiple and single inheritance, either by replacing a generalisation by a 0..1 to 1 association, or by merging a class and its superclass(es). This establishes Generalization = {}. phase3: Introduce a primary key for each class. phase4 : Replace many-many associations with a new class and foreign keys, replace 1-many associations by foreign keys. This establishes Association = {}. 17

18
Transformation algorithm 18

19
Questions? 19

Similar presentations

© 2017 SlidePlayer.com Inc.

All rights reserved.

Ads by Google