runtime interoperability of transformation engines
play

Runtime Interoperability of Transformation Engines 1150 1150 - PowerPoint PPT Presentation

Runtime Interoperability of Transformation Engines 1150 1150 Massimo Tisi AtlanMod Nantes, France Massimo.Tisi@inria.fr Runtime Interoperability of Transformation Engines 1150 1150 Massimo Tisi AtlanMod Nantes, France


  1. Runtime Interoperability of Transformation Engines 1150 1150 Massimo Tisi AtlanMod Nantes, France Massimo.Tisi@inria.fr

  2. Runtime Interoperability of Transformation Engines 1150 1150 Massimo Tisi AtlanMod Nantes, France Massimo.Tisi@inria.fr

  3. An Identity Crisis 1150 1150 Massimo Tisi AtlanMod Nantes, France Massimo.Tisi@inria.fr

  4. ATL GRoundTram

  5. ATL EMF Model EMF Model UnQL Graph Graph

  6. ATL EMF Model EMF Model ATL2UnQL EMF2Graph UnQL Graph Graph

  7. ATL update EMF Model EMF Model ATL2UnQL update EMF2Graph propagation UnQL Graph Graph

  8. ATL EMF Model EMF Model ATL2? EMF2? ? ? ?  CSP  ASM  Maude  ...

  9.  TGG  QVT  XSLT  … ?  ? ? ?2UnQL ?2Graph UnQL Graph Graph

  10. L1 SM1 TM1 f1 l m m' L2 f2 SM2 TM2

  11. In an ideal world... L1 SM1 TM1 f1 m m L2 f2 SM2 TM2

  12. In an ideal world... L1 SM1 TM1 f1 m m L2 f2 SM2 TM2 ...but we are not in an ideal world :(

  13. Realistic Hypothesis 1  m is injective  from abstract to concrete  no information loss  all information from SM1 is encoded in SM2  good bidirectionality properties with m'  at least get-put?

  14. Realistic Hypothesis 2  l is not injective  Not all the language features are translated  Why? 1. not possible -> very different semantics of L1 and L2 2. possible but we don't want to:  e.g., we just want to translate the bidirectionalizable part 3. possible but we just don't have time  Result: f1 is “semantically different” from f2  TM2 != m(TM1)

  15. Partial translation  If we allow any translation l, we could end up with a TM2 completely unrelated with TM1  We are interested in “approximations by defect” of a perfect translation  We say that l is a partial translation of a model transformation when it is always guaranteed that:  TM2 is part-of m(TM1)  (or for graphs: TM2 is a subgraph of m(TM1))

  16. The problem L1 SM1 TM1 f1 l m m' ? ? L2 f2 SM2 TM2  To say more we need to go down to the model-element level

  17. Class models and Relational models type attrs Family: Class family : Attribute Person: Class attrs type attrs members: Attribute name: Attribute firstName: Attribute multivalued = true type type String: Datatype type cols Family: Table family : Column Person: Table cols cols name: Column firstName: Column type type String: Type

  18. rule Class2Table { Class2Relational.atl from s : ClassDiagram!Class to t : Relational!Table ( name <- s.name, col <- s.attr type attrs ) Family: Class family : Attribute Person: Class } attrs type attrs members: Attribute name: Attribute firstName: Attribute multivalued = true Trace Link type type String: Datatype type cols Family: Table family : Column Person: Table cols cols name: Column firstName: Column type type String: Type

  19. rule Class2Table { Class2Relational.atl from s : ClassDiagram!Class to t : Relational!Table ( name <- s.name, col <- s.attr type attrs ) Family: Class family : Attribute Person: Class } attrs type attrs members: Attribute name: Attribute firstName: Attribute multivalued = true Trace Link type type String: Datatype type cols Family: Table family : Column Person: Table cols cols name: Column firstName: Column rule Attribute2Column { type type from String: Type s : ClassDiagram!Attribute ( not s.multiValued guard ) to Guards and bindings are OCL t : Relational!Column ( expressions over the source model name <- s.name, type <- s.type bindings ) }

  20. Class2Relational.atl module Class2Relational; create OUT : Relational from IN : ClassDiagram; rule Datatype2Type { from s : ClassDiagram!DataType to t : Relational!Type (  But there is much more: name <- s.name ) }  Matching multiple elements rule Class2Table { per rule from s : ClassDiagram!Class  Generating multiple to t : Relational!Table ( elements per rule name <- s.name, col <- s.attr  OCL functions (helpers) ) }  Explicit inter-rule activation rule Attribute2Column { (lazy rules) from s : ClassDiagram!Attribute (  Imperative blocks not s.multiValued ) to t : Relational!Column ( name <- s.name, type <- s.type ) }

  21. Trace links Source Model Destination Model rule1 t A G u I rule2 v B C J t H rule3 E t K

  22. Trace links Source Model Destination Model rule1 t A G u I rule2 v B C J t H rule3 E t K

  23. Trace links Source Model Destination Model rule1 t A G u I rule2 v B C J t H rule3 E t K J?

  24. J: who am I? J

  25. 1. Identity by trace links rule1 t A G u I rule2 v B C J t H rule3 E t K J!

  26.  But:  Not a clear 1-to-1 relationship in ATL2UnQL  Even if we modify ATL2UnQL we don't want to modify UnQL to UnCAL ATL EMF Model EMF Model ATL2UnQL EMF2Graph UnQL Graph Graph UnCAL

  27. 2. Identity by identifiers  Modeling frameworks have a notion of model-element identity  E.g., in EMF:  Users can set an explicit ID for each model element  It is serialized as an XML ID when the model is serialized to XMI/XML  Otherwise the system uses an implicit ID  the Java object ID while it is in memory  an XMI ID when the model is serialized to XMI  quite similar to XPath  e.g., “/0/@elements.3/@inPattern/@elements.0”  Users are encouraged to abstract from IDs

  28. 2a. Emulating identifiers rule1 t A G u I rule2 v B C J ID J =“/0/@elements.1” t H rule3 E t K J! /0/@elements.1

  29.  But:  Implicit identifiers depend on several factors that cannot be easily emulated  Non-determinism in the serialization format  Changes among EMF versions  Structure of the file  e.g., element ordering in non-ordered references  Non-determinism in the serializer  Non-determinism in the transformation language  Changes among ATL versions or ATL implementations  Because of the partial translation!

  30. 2b. “Lifting” Identity ATL EMF Model IDFIER EMF Model ATL EMF Model explicit IDs ATL2UnQL EMF2Graph UnQL Graph Graph

  31. The IDFIER HOT rule Class2Table { from s : ClassDiagram!Class to t : Relational!Table ( name <- s.name, col <- s.attr ) } rule Class2Table { from s : ClassDiagram!Class to t : Relational!Table ( __xmiID__ <- 'IN'.concat(s.__xmiID__.concat('.Class2Table.t')), name <- s.name, col <- s.attr ) }

  32. rule1 t A G u I rule2 v B C J ID J =“IN.A.rule1.v” t H rule3 E t K J! IN.A.rule1.v

  33. “Lifting” identity  The logic for identification is “lifted”  from an implicit semantics in the modeling framework  to an explicit transformation rule  that is composed with the given ATL transformation

  34. Benefits  We keep element identity in TM1 and TM2  With no changes to the two transformation engines  With no changes to the translator l  that is totally agnostic w.r.t the ID format  and goes on working if we change it  Transparently for a tool that uses SM1/L1/TM1  But not for a tool that uses SM2/L2/TM2  Supporting partial translations

  35. Future work  A good formalization  Some category theory?  Complete analysis of identification methods  e.g., adding structural comparison  Application to runtime ATL-GRoundTram interaction

  36. Thanks Massimo Tisi - 36/36

Download Presentation
Download Policy: The content available on the website is offered to you 'AS IS' for your personal information and use only. It cannot be commercialized, licensed, or distributed on other websites without prior consent from the author. To download a presentation, simply click this link. If you encounter any difficulties during the download process, it's possible that the publisher has removed the file from their server.

Recommend


More recommend