Language Features for Re-Use and Maintainability of MDA Transformations Michael Lawley, Keith Duddy, Anna Gerber, Kerry Ra...
Styles of transformation <ul><li>Source-driven </li></ul><ul><ul><li>Organized by source model concept </li></ul></ul><ul>...
<ul><li>Rules may be reused in two ways: </li></ul><ul><ul><li>Rule Extension Allows </li></ul></ul><ul><ul><ul><li>Additi...
Indirect rule coupling <ul><li>Tracking Classes are MOF Classes </li></ul><ul><li>their instances relate source extent ele...
Mappings between UML, DL, OWL and ER
Example: UML and DL <ul><li>TRANSFORMATION UML2DL(uml,dl) </li></ul><ul><li>RULE Assoc2Role (a,r) </li></ul><ul><li>FORALL...
Example: ER and DL <ul><li>TRANSFORMATION ER2DL(er,dl) </li></ul><ul><li>RULE Relationship2Role(r1,r2) </li></ul><ul><li>F...
Example: UML and DL extended <ul><li>TRANSFORMATION DLfromOWL2UML(dl,owl2dl,uml) </li></ul><ul><li>EXTENDS DL2UML(dl,uml) ...
Example: ER and DL extended <ul><li>TRANSFORMATION DLfromUML2ER(dl,uml2dl,er) </li></ul><ul><li>EXTENDS DL2ER(dl,er) </li>...
The Simple UML Model
The Simple Relational Model
The Mapping (Tracking) Model
UML RDBMS TableForClass N: String ObjRelTX C 1 C 1 A 1 Col 1 T 1 Class Attribute ColumnFor ContainedAttr Column Table
1. A class maps on to a single table  <ul><li>Issues not considered in the description:  </li></ul><ul><li>Only &quot;pers...
Non-extension style for Attr2Col Rule <ul><li>RULE Attr2Column(c, a, t, col, t4c) </li></ul><ul><li>FORALL Attribute a </l...
<ul><li>% Immediate Attributes of a Class that are  </li></ul><ul><li>% primary have their corresponding Column  </li></ul...
<ul><li>% Produce a Column and a ForeignKey for every </li></ul><ul><li>% Association. </li></ul><ul><li>RULE ColumnAndFor...
Upcoming SlideShare
Loading in …5
×

Language Features for Re-Use and Maintainability of MDA Transformations

652 views
610 views

Published on

Published in: Business, Technology
0 Comments
0 Likes
Statistics
Notes
  • Be the first to comment

  • Be the first to like this

No Downloads
Views
Total views
652
On SlideShare
0
From Embeds
0
Number of Embeds
55
Actions
Shares
0
Downloads
0
Comments
0
Likes
0
Embeds 0
No embeds

No notes for slide

Language Features for Re-Use and Maintainability of MDA Transformations

  1. 1. Language Features for Re-Use and Maintainability of MDA Transformations Michael Lawley, Keith Duddy, Anna Gerber, Kerry Raymond
  2. 2. Styles of transformation <ul><li>Source-driven </li></ul><ul><ul><li>Organized by source model concept </li></ul></ul><ul><li>Target-driven </li></ul><ul><ul><li>Organized by target model concept </li></ul></ul><ul><li>Aspect-driven </li></ul><ul><ul><li>Organized by conceptual relationship between source and target models, eg inheritance, containment </li></ul></ul>
  3. 3. <ul><li>Rules may be reused in two ways: </li></ul><ul><ul><li>Rule Extension Allows </li></ul></ul><ul><ul><ul><li>Additional clauses to be added to source match </li></ul></ul></ul><ul><ul><ul><li>Additional model elements to be created in target </li></ul></ul></ul><ul><ul><li>Rule Overriding Allows </li></ul></ul><ul><ul><ul><li>Additional clauses to be added to match </li></ul></ul></ul><ul><ul><ul><li>Overriding the superseded rule to apply a different target expression to the original rule </li></ul></ul></ul>
  4. 4. Indirect rule coupling <ul><li>Tracking Classes are MOF Classes </li></ul><ul><li>their instances relate source extent elements to target extent elements and are created because of a rule match </li></ul><ul><li>may be used in the source term of a rule to “query” target model elements “created” by other rules </li></ul>
  5. 5. Mappings between UML, DL, OWL and ER
  6. 6. Example: UML and DL <ul><li>TRANSFORMATION UML2DL(uml,dl) </li></ul><ul><li>RULE Assoc2Role (a,r) </li></ul><ul><li>FORALL UMLAssoc a </li></ul><ul><li>MAKE DLRole r </li></ul><ul><li>SET r.uniqueID = a.name; </li></ul><ul><li>RULE Attr2Role (a,r) </li></ul><ul><li>FORALL UMLAttr a </li></ul><ul><li>MAKE DLRole r </li></ul><ul><li>SET r.uniqueID = a.name </li></ul><ul><li>LINKING RoleForAttr </li></ul><ul><li>WITH attr = a, role = r; </li></ul><ul><li>RULE Class2Concept(c1,c2) </li></ul><ul><li>FORALL UMLClass c1 </li></ul><ul><li>MAKE DLConcept c2 </li></ul><ul><li>SET c2.uniqueID = c1.name; </li></ul><ul><li>TRANSFORMATION DL2UML(dl,uml) </li></ul><ul><li>RULE Role2Assoc(r,a) </li></ul><ul><li>FORALL DLRole r </li></ul><ul><li>MAKE UMLAssoc a </li></ul><ul><li>SET a.name = r.uniqueID; </li></ul><ul><li>RULE Concept2Class(c1,c2) </li></ul><ul><li>FORALL DLConcept c1 </li></ul><ul><li>MAKE UMLCLass c2 </li></ul><ul><li>SET c2.name = c1.uniqueID; </li></ul>
  7. 7. Example: ER and DL <ul><li>TRANSFORMATION ER2DL(er,dl) </li></ul><ul><li>RULE Relationship2Role(r1,r2) </li></ul><ul><li>FORALL ERRelationship r1 </li></ul><ul><li>MAKE DLRole r2 </li></ul><ul><li>SET r2.uniqueID = r1.name; </li></ul><ul><li>RULE Attribute2Role(a,r) </li></ul><ul><li>FORALL ERAttribute a </li></ul><ul><li>MAKE DLRole r </li></ul><ul><li>SET r.uniqueID = a.name; </li></ul><ul><li>RULE Entity2Concept(e,c) </li></ul><ul><li>FORALL EREntity e </li></ul><ul><li>MAKE DLConcept c </li></ul><ul><li>SET c.uniqueID = e.name; </li></ul><ul><li>TRANSFORMATION DL2ER(dl,er) </li></ul><ul><li>RULE Role2Relationship(r1,r2) </li></ul><ul><li>FORALL DLRole r1 </li></ul><ul><li>MAKE ERRelationship r2 </li></ul><ul><li>SET r2.name = r1.uniqueID; </li></ul><ul><li>RULE Concept2Entity (c,e) </li></ul><ul><li>FORALL DLConcept c </li></ul><ul><li>MAKE EREntity e </li></ul><ul><li>SET e.name = c.uniqueID; </li></ul>
  8. 8. Example: UML and DL extended <ul><li>TRANSFORMATION DLfromOWL2UML(dl,owl2dl,uml) </li></ul><ul><li>EXTENDS DL2UML(dl,uml) </li></ul><ul><li>RULE Role2Attr(r,a) </li></ul><ul><li>OVERRIDES Role2Assoc(r,a) </li></ul><ul><li>FORALL PropForRole@owl2dl pr </li></ul><ul><li>WHERE pr.role = r AND pr.prop = p </li></ul><ul><li>AND OWLDataTypeProperty p </li></ul><ul><li>MAKE UMLAttribute a FROM r </li></ul><ul><li>SET a.name = r.uniqueID; </li></ul><ul><li>LINKING RoleForAttr </li></ul><ul><li>WITH attr = a, role = r; </li></ul>
  9. 9. Example: ER and DL extended <ul><li>TRANSFORMATION DLfromUML2ER(dl,uml2dl,er) </li></ul><ul><li>EXTENDS DL2ER(dl,er) </li></ul><ul><li>RULE Role2Attribute_fromUML(r,a) </li></ul><ul><li>OVERRIDES Role2Relationship(r,rel) </li></ul><ul><li>FORALL RoleForAttr@uml2dl ra </li></ul><ul><li>WHERE ra.role = r </li></ul><ul><li>MAKE ERAttribute a FROM r </li></ul><ul><li>SET a.name = r.uniqueID; </li></ul>
  10. 10. The Simple UML Model
  11. 11. The Simple Relational Model
  12. 12. The Mapping (Tracking) Model
  13. 13. UML RDBMS TableForClass N: String ObjRelTX C 1 C 1 A 1 Col 1 T 1 Class Attribute ColumnFor ContainedAttr Column Table
  14. 14. 1. A class maps on to a single table <ul><li>Issues not considered in the description: </li></ul><ul><li>Only &quot;persistent&quot; UML Classes should be mapped </li></ul><ul><li>How should key columns be named? We choose the name of the Class </li></ul><ul><li>RULE Class2Table(c, t, k) </li></ul><ul><li>FORALL UMLClass c </li></ul><ul><li>WHERE c.kind = &quot;persistent&quot; </li></ul><ul><li>MAKE Table t, Key k </li></ul><ul><li>SET t.name = c.name, t.key = k, </li></ul><ul><li>k.name = c.name </li></ul><ul><li>LINKING TableForClass </li></ul><ul><li>WITH cls = c, tbl = t </li></ul><ul><li>LINKING KeyForClass </li></ul><ul><li>WITH cls = c, key = k; </li></ul>
  15. 15. Non-extension style for Attr2Col Rule <ul><li>RULE Attr2Column(c, a, t, col, t4c) </li></ul><ul><li>FORALL Attribute a </li></ul><ul><li>WHERE TableForClass t4c </li></ul><ul><li>LINKS cls = c, tbl = t </li></ul><ul><li>AND hasAttr(c, a, n) </li></ul><ul><li>MAKE Column col FROM colName(n) </li></ul><ul><li>SET col.name = n, </li></ul><ul><li>col.owner = t, </li></ul><ul><li>t4c.cols = col </li></ul><ul><li>LINKING ColumnForContainedAttr </li></ul><ul><li>WITH cls = c, attr = a, </li></ul><ul><li>name = n, col = col; </li></ul>
  16. 16. <ul><li>% Immediate Attributes of a Class that are </li></ul><ul><li>% primary have their corresponding Column </li></ul><ul><li>% as part of the Table's Key. </li></ul><ul><li>RULE KeyColumns(c, a, k, col) </li></ul><ul><li>WHERE ColumnForContainedAttr </li></ul><ul><li>LINKS cls = c, attr = a, col = col </li></ul><ul><li>AND a.kind = &quot;primary&quot; AND inhAttr(c, a) </li></ul><ul><li>SET col.belongsTo = k; </li></ul>
  17. 17. <ul><li>% Produce a Column and a ForeignKey for every </li></ul><ul><li>% Association. </li></ul><ul><li>RULE ColumnAndForeignKeyForAssoc(assoc, tbl, key) </li></ul><ul><li>FORALL Association assoc </li></ul><ul><li>WHERE TableForClass </li></ul><ul><li>LINKS class = assoc.source, table = tbl </li></ul><ul><li>AND KeyForClass </li></ul><ul><li>LINKS class = assoc.destination, key = key </li></ul><ul><li>MAKE Column col, ForeignKey fk </li></ul><ul><li>SET col.name = assoc.name, col.owner = tbl, </li></ul><ul><li>fk.owner = tbl, fk.column = col, </li></ul><ul><li>fk.refersTo = key </li></ul><ul><li>LINKING ColumnForAssociation </li></ul><ul><li>WITH assoc = assoc, col = col, fkey = fk; </li></ul>

×