MPM 10 Towards Transformation Rule Composition Mrk Asztalos

  • Slides: 24
Download presentation
MPM’ 10 Towards Transformation Rule Composition Márk Asztalos, Eugene Syriani, Manuel Wimmer, and Marouane

MPM’ 10 Towards Transformation Rule Composition Márk Asztalos, Eugene Syriani, Manuel Wimmer, and Marouane Kessentini Ph. D. Candidate in the Modelling, Simulation, and Design Lab School of Computer Science Mc. Gill University

Towards Transformation Rule Composition MPM’ 10 OUTLINE q Context q Rule Composition q Composability

Towards Transformation Rule Composition MPM’ 10 OUTLINE q Context q Rule Composition q Composability Criteria q Composition Procedure q Example: UML EJB 2. 0 EJB 3. 0 q Conclusion 2

Towards Transformation Rule Composition MPM’ 10 CONTEXT Enterprise Development Company Requirements Design Development Maintenance

Towards Transformation Rule Composition MPM’ 10 CONTEXT Enterprise Development Company Requirements Design Development Maintenance 3

MPM’ 10 Towards Transformation Rule Composition CONTEXT Enterprise Development Company Design Development 4

MPM’ 10 Towards Transformation Rule Composition CONTEXT Enterprise Development Company Design Development 4

MPM’ 10 Towards Transformation Rule Composition CONTEXT Enterprise Development Company Design Development v 2.

MPM’ 10 Towards Transformation Rule Composition CONTEXT Enterprise Development Company Design Development v 2. 0 v 3. 0 5

Towards Transformation Rule Composition MPM’ 10 IS IT POSSIBLE TO AUTOMATICALLY DERIVE T 3?

Towards Transformation Rule Composition MPM’ 10 IS IT POSSIBLE TO AUTOMATICALLY DERIVE T 3? That is the question EJB 3 meta-model UML meta-model ? T 1 T 2 T 3 EJB 2 meta-model 6

Towards Transformation Rule Composition MPM’ 10 IS IT POSSIBLE TO AUTOMATICALLY DERIVE T 3?

Towards Transformation Rule Composition MPM’ 10 IS IT POSSIBLE TO AUTOMATICALLY DERIVE T 3? • In general this is a very hard task • Instead we will try to solve the problem at the rule level b 2: EJBArchive 2 a 1: Package UML class TO EJB 2 archive T b 3: Deploy. Desc T 3 UML class TO EJB 3 archive EJB 2 archive TO EJB 3 archive c 1: EJBArchive 2 T T d 2: EJBArchive 3 T 2 T 1 a 1: Package d 2: EJBArchive 3 7

MPM’ 10 Towards Transformation Rule Composition ASSUMPTIONS Transformation Chain • We assume an exogenous

MPM’ 10 Towards Transformation Rule Composition ASSUMPTIONS Transformation Chain • We assume an exogenous chain of transformations • Rules of the transformations are algebraic graph transformation rules [1] • Rules must produce traceability links such that every newly created element must have at least one trace link a 1: Package T d 2: EJBArchive 3 [1] H. Ehrig, K. Ehrig, U. Prange, G. Taentzer. Fundamentals of Algebraic Graph Transformation. EATCS, Springer-Verlag, 2006. 8

Towards Transformation Rule Composition MPM’ 10 WHAT DO WE MEAN BY COMPOSITION? For any

Towards Transformation Rule Composition MPM’ 10 WHAT DO WE MEAN BY COMPOSITION? For any model m 1, m 2 = T 1(m 1) and m 3 = T 2(m 2) we define m’ = T 3(m 1) = T 2 T 1(m 1) such that: • Soundness & Completeness: – m 1 is preserved in m’ – All elements produced by T 2 are present in m’ – m’ contains no other elements then those in m 3 • Elimination: – No element from m 2 shall be present in m’ – No traceability link involving elements from MM 2 must be present in m’ • Transitivity – If there is a trace link 12 between an element e 1 m 1 and an element e 2 in m 2 AND there is a trace link 23 between e 2 and an element e 3 m 3 Then there must be a trace link 13 m’ between e 1 and e 3 9

MPM’ 10 Towards Transformation Rule Composition ASSUMPTIONS Composability Criteria Two rules (LHS 1 ,

MPM’ 10 Towards Transformation Rule Composition ASSUMPTIONS Composability Criteria Two rules (LHS 1 , RHS 1) and (LHS 2 , RHS 2) are composable if: Every element in LHS 2 that is part of MM 2 is present in RHS 1 b 2: EJBArchive 2 a 1: Package T b 3: Deploy. Desc c 1: EJBArchive 2 T d 2: EJBArchive 3 10

MPM’ 10 Towards Transformation Rule Composition RULE COMPOSITION PROCEDURE • The Composability Criteria specifies

MPM’ 10 Towards Transformation Rule Composition RULE COMPOSITION PROCEDURE • The Composability Criteria specifies the pre-condition • The Composition Definition specifies the post-condition • In [1], Ehrig et. al. have proven that the composition of two graph transformation rules is possible [1] H. Ehrig, K. Ehrig, U. Prange, G. Taentzer. Fundamentals of Algebraic Graph Transformation. EATCS, Springer-Verlag, 2006. 11

Towards Transformation Rule Composition MPM’ 10 GRAPH TRANSFORMATION RULE APPLICATION L K R g.

Towards Transformation Rule Composition MPM’ 10 GRAPH TRANSFORMATION RULE APPLICATION L K R g. Link right m up g. Link right left down up right p. Link left G down g. Link up down right f. Link p. Link left f. Link H If there exists an occurrence of L in G then replace it with R 12

MPM’ 10 Towards Transformation Rule Composition RULE COMPOSITION PROCEDURE • In [1], Ehrig et.

MPM’ 10 Towards Transformation Rule Composition RULE COMPOSITION PROCEDURE • In [1], Ehrig et. al. have proven that the composition of two graph transformation rules is possible – By computing the so-called E-concurrent graph of the two rules • BUT theorem does not say how to precisely construct the new rule r’ = r 2 r 1 • How to construct the L, K, and R parts of r’? [1] H. Ehrig, K. Ehrig, U. Prange, G. Taentzer. Fundamentals of Algebraic Graph Transformation. EATCS, Springer-Verlag, 2006. 13

Towards Transformation Rule Composition MPM’ 10 RULE COMPOSITION PROCEDURE Eliminate MM 2 elements and

Towards Transformation Rule Composition MPM’ 10 RULE COMPOSITION PROCEDURE Eliminate MM 2 elements and related trace links and compute transitive trace links a 1, b 2 a 1: Package a 1, b 3 b 2: EJBArchive 2 b 2, d 2: EJBArchive 3 a 1, d 2 b 3: Deploy. Desc 14

Towards Transformation Rule Composition MPM’ 10 RULE COMPOSITION PROCEDURE E: b 2: EJBArchive 2

Towards Transformation Rule Composition MPM’ 10 RULE COMPOSITION PROCEDURE E: b 2: EJBArchive 2 R 3: T a 1: Package b 2: EJBArchive 2 r 1: a 1: Package T b 2: EJBArchive 2 T T d 2: EJBArchive 3 Td 2: EJBArchive 3 b 3: Deploy. Desc T b 3: Deploy. Desc r 2: c 1: EJBArchive 2 r 3: a 1: Package c 1: EJBArchive 2 T d 2: EJBArchive 3 15

MPM’ 10 Towards Transformation Rule Composition RULE COMPOSITION PROCEDURE Negative Application Conditions • If

MPM’ 10 Towards Transformation Rule Composition RULE COMPOSITION PROCEDURE Negative Application Conditions • If the NAC of r 1 corresponds to its RHS, then add a NAC to r 3 that corresponds to its RHS • If the NAC of r 2 corresponds to its RHS, then it is taken into account when applying r 2 on E • Considering other arbitrary NACs is not trivial, as they can be – Overlapping with the LHS – Completely independent from the LHS In either case, need knowledge of other rules involved 16

Towards Transformation Rule Composition MPM’ 10 SOLVING THE UML EJB 2 EJB 3 MIGRATION

Towards Transformation Rule Composition MPM’ 10 SOLVING THE UML EJB 2 EJB 3 MIGRATION CASE EJB 3 meta-model UML meta-model T 3 T 2 T 1 EJB 2 meta-model 17

Towards Transformation Rule Composition MPM’ 10 UML EJB 2 EJB 3 COMPOSITION UML Class

Towards Transformation Rule Composition MPM’ 10 UML EJB 2 EJB 3 COMPOSITION UML Class Diagram TO EJB 2. 0 R 1: a 1: Package T a 1: Package b 3: Deploy. Desc b 2: EJBArchive 2 T b 3: Deploy. Desc a 1: Package R 2: b 2: EJBArchive 2 T b 7: Entity. Entry a 4: Class T a 1: Package b 6: Interface b 3: Deploy. Desc a 1: Package b 7: Entity. Entry b 3: Deploy. Desc a 4: Class b 5: Entity. Bean name = a 4. name b 2: EJBArchive 2 T T a 4: Class name = a 4. name b 2: EJBArchive 2 b 3: Deploy. Desc a 1: Package R 3: b 7: Session. Entry is. Stateful = false a 4: Class T b 5: Session. Bean b 2: EJBArchive 2 T name = a 4. name b 2: EJBArchive 2 T b 3: Deploy. Desc a 1: Package b 7: Session. Entry b 3: Deploy. Desc is. Stateful = false a 1: Package a 4: Class name = a 4. name b 6: Interface is. Persistent = true name = a 4. name T b 5: Entity. Bean a 4: Class is. Persistent = false T b 5: Session. Bean name = a 4. name b 6: Interface name = a 4. name 18

Towards Transformation Rule Composition MPM’ 10 UML EJB 2 EJB 3 COMPOSITION EJB 2.

Towards Transformation Rule Composition MPM’ 10 UML EJB 2 EJB 3 COMPOSITION EJB 2. 0 TO EJB 3. 0 R 1: T R 2: T c 1: EJBArchive 2 d 2: EJBArchive 3 c 1: EJBArchive 2 d 6: Entity. Bean name = c 4. name c 4: Entity. Bean T d 7: Interface name = c 4. name T R 3: d 2: EJBArchive 3 d 6: Session. Bean c 1: EJBArchive 2 c 3: Session. Bean T c 5: Session. Entry T R 4: c 3: Session. Bean c 5: Session. Entry T T c 1: EJBArchive 2 d 2: EJBArchive 3 T T d 7: Interface d 2: EJBArchive 3 T c 3: Session. Bean c 5: Session. Entry is. Stateful = false d 2: EJBArchive 3 d 6: Session. Bean name = c 3. name T c 5: Session. Entry T c 1: EJBArchive 2 d 7: Interface c 3: Session. Bean c 5: Session. Entry is. Stateful = true c 5: Session. Entry d 7: Interface name = c 3. name d 8: Stateless d 2: EJBArchive 3 T name = c 3. name d 8: Stateful d 6: Entity. Bean name = c 4. name c 3: Session. Bean name = c 3. name d 2: EJBArchive 3 c 4: Entity. Bean d 7: Interface d 6: Session. Bean d 2: EJBArchive 3 name = c 4. name c 4: Entity. Bean c 1: EJBArchive 2 name = c 3. name T c 1: EJBArchive 2 d 2: EJBArchive 3 T d 2: EJBArchive 3 c 1: EJBArchive 2 name = c 3. name d 8: Stateless c 1: EJBArchive 2 d 6: Session. Bean name = c 3. name T d 7: Interface name = c 3. name d 8: Stateful 19

MPM’ 10 Towards Transformation Rule Composition UML EJB 2 EJB 3 COMPOSITION Composability Matrix

MPM’ 10 Towards Transformation Rule Composition UML EJB 2 EJB 3 COMPOSITION Composability Matrix T 2 T 1 T 2: R 2 T 2: R 3 T 2: R 4 T 1: R 1 YES NO NO NO T 1: R 2 YES NO NO T 1: R 3 YES NO 20

Towards Transformation Rule Composition MPM’ 10 UML EJB 2 EJB 3 COMPOSITION T 3:

Towards Transformation Rule Composition MPM’ 10 UML EJB 2 EJB 3 COMPOSITION T 3: R 1 = T 2: R 1 T 1: R 1 T c 1: EJBArchive 2 d 2: EJBArchive 3 c 1: EJBArchive 2 T d 2: EJBArchive 3 b 2: EJBArchive 2 T a 1: Package T b 3: Deploy. Desc = a 1: Package T d 2: EJBArchive 3 21

Towards Transformation Rule Composition MPM’ 10 UML EJB 2 EJB 3 COMPOSITION T 3:

Towards Transformation Rule Composition MPM’ 10 UML EJB 2 EJB 3 COMPOSITION T 3: R 2 = T 2: R 2 T 1: R 2 T d 2: EJBArchive 3 c 1: EJBArchive 2 d 6: Entity. Bean name = c 4. name c 4: Entity. Bean T d 7: Interface name = c 4. name d 2: EJBArchive 3 T T c 1: EJBArchive 2 = d 6: Entity. Bean name = c 4. name c 4: Entity. Bean d 2: EJBArchive 3 T d 7: Interface name = c 4. name 22

MPM’ 10 Towards Transformation Rule Composition UML EJB 2 EJB 3 COMPOSITION T 3:

MPM’ 10 Towards Transformation Rule Composition UML EJB 2 EJB 3 COMPOSITION T 3: R 3 = T 2: R 3 T 1: R 3 = 23

Towards Transformation Rule Composition MPM’ 10 CONCLUSION • Composition procedure – Given two transformation

Towards Transformation Rule Composition MPM’ 10 CONCLUSION • Composition procedure – Given two transformation rules – Produces the composite of the two rules (transitive closure) • Composition detection • Implemented in – ATL: compiled to graph transformation rules – EMF Tiger: § detect composable rules § Output the composite rule • How to deal with more complex transformation? – Arbitrary NACs – Arbitrary attribute constraints – Workflow structure (priority, layer, explicit control flow, . . . ) 24