1 / 48

A Template-Based Model Transformation Approach Using A Simplified Hierarchical Metamodel 

A Template-Based Model Transformation Approach Using A Simplified Hierarchical Metamodel . Ph.D Dissertation Hongming Liu DePaul University. Agenda. Introduction Motivation HRMT Approach Case Study: HIMS Related Work and Evaluation Contributions. MDE .

taliesin
Download Presentation

A Template-Based Model Transformation Approach Using A Simplified Hierarchical Metamodel 

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. A Template-Based Model Transformation Approach Using A Simplified Hierarchical Metamodel  Ph.D DissertationHongming LiuDePaul University

  2. Agenda • Introduction • Motivation • HRMT Approach • Case Study: HIMS • Related Work and Evaluation • Contributions

  3. MDE • Using models to direct the course of understanding, design, construction, deployment, operation, maintenance and modification. • Transform abstract model into system implementation • Benefits of MDE

  4. Model Transformation • A core concept to support MDE • Transform a Platform Independent Model(PIM) to Platform Specific Model(PSM) • A model transformer is similar to a compiler • Transformation requires a clear understanding of the abstract syntax and semantics of both the source models and target models

  5. Model Transformation Overview Relational Template .NET Template EJB Template

  6. State of the Art • UML as the de facto modeling language • UML 2.2 • Object Constrain Language(OCL) • UML 3.0? • MDA initiative of OMG • Model Object Facility(MOF) • Query/View/Transformation(QVT)

  7. MDE Obstacles • Problems of UML and OCL • Large and complex • Inconsistent • Loose semantics • Difficult syntax of OCL • Inadequate tools support • Lack of effective transformation mechanism

  8. Proposed Approach A model transformations framework • Based on ZOOM notation • Use Hierarchical Relational Metamodel(HRM) • Template based transformation • Aims to provide a simple, effective, and practical way to define model transformations

  9. HRMT Approach

  10. HRMT Approach • Source Model Representation • Hierarchical Relational Metamodel • Transformation Template • Transformation Control Algorithm • Post Processing

  11. Hierarchical Relational Metamodel A Hierarchical Relational Metamodel HRM = (N, C, R) N a set of nodes: N = {n1, n2, ... ni } C a relation on N X N, which forms a tree structure that has one root and no unconnected nodes. R a set of relation on N X N

  12. HRM Example

  13. Model Transformation Rules • A transformation rule set R = {r1, r2, r3... rn} a set of model transformation rules • A transformation rule r = (P --> Tpre, Tpost) P: pattern to select the elements of source model Tpre: mapping before traversing children of selected element Tpost: mapping after traversing children of selected element

  14. Transformation Control Algorithm

  15. Transformation Process

  16. Transformation Process

  17. Transformation Process

  18. Development of Transformation • CSL Roster Example • Basic Classes • Classes with associations • Generation of EJB Entities • Generation of comprehensive EJB applications

  19. CSL Roster Example

  20. Case Study: HIMS • Hospital Information Management System • Electronic Healthcare Record • Functional Requirement • Non-Functional Requirement

  21. HISM <Rule match="Struct"> <Pre> <![CDATA[ <File name="view${name}.aspx"> <%@ Page Language="C#" %> ... Healthcare Information Management System <asp:GridView id="ctrlDataGrid" runat="server" ... </asp:GridView> <asp:SqlDataSource ID="ctrlDataSource" runat="server" ProviderName="System.Data.OleDb" ConnectionString=..."/> @table struct MedicalDataTemplate { int id; String desc; String SecurityLevel; String format; String attachment; }

  22. HISM <%@ Page Language="C#" %> <html xmlns="http://www.w3.org/1999/xhtml"> <font size=4><strong>Show all the available medical data</strong></font> </p> <form id="WebForm" runat="server" > <asp:GridView id="ctrlDataGrid" runat="server" DataSourceID="ctrlDataSource" HeaderStyle-BackColor="#CCCCCC" CellSpacing="0" CellPadding="5" Width="400" AutoGenerateColumns="false" > <Columns> <asp:BoundField HeaderText="Patient ID" DataField="patientid"/> …. </Columns> </asp:GridView> </p> <asp:SqlDataSource ID="ctrlDataSource" runat="server" ProviderName="System.Data.OleDb" ConnectionString="Provider=Microsoft.Jet.OLEDB.4.0; Data Source=e:\ectserver\jliu\Database\hospital.mdb" SelectCommand="SELECT * FROM [medicaldata]" />

  23. HISM

  24. Features Illustrated by Case Study • Multi-platform support • Security requirement support • Scalability requirement support • Performance requirement support

  25. Evaluation • Choice of Test case • CSL Roster example • Choice of Metrics • Choice of transformation tools

  26. CSL Roster Example

  27. Evaluation Metrics • Total Line/Token • Nesting Depth • Cross Reference - Inner cross reference/outer cross reference • Reference to Metamodel - reference/unique reference

  28. Evaluation Metrics

  29. Model Transformation Tools • Jamda Direct model manipulation using visitor mechanism • Stylus Studio Using XSLT stylesheet to describe mapping rules • AndroMDA An extensible template-based code generator • ATL Comply to the QVT standard(UML,MOF,XMI)

  30. Evaluation • Evaluation Result Reflecting Metamodel Complicity

  31. Evaluation • Evaluation Result Reflecting Transformation Complicity

  32. Evaluation • Evaluation Result of Transformation Tools

  33. Contribution • A Template Based Model Transformation Approach Using Simplified Metamodel • Benefits of our approach: • Simplicity of source modeling language • Readability of transformation definition • Support of non-functional requirement

  34. Thank You! Questions/Comments?

  35. Our Vision for MDE Our vision for MDE centers on • Notations for capturing formal and complete models of all aspects • Knowledge-based approaches and tools that transform models into complete applications through a process known as model compilation.

  36. MOF • MOF stands for Meta Object Facility • enables meta-metamodeling of UML level metamodels • It defines a small set of concepts (such as package, class, method, attribute…) That • allow one to define and manipulate models of metadata (data about data) • are described using a subset UML notation

  37. ZOOM Architecture

  38. Why ZOOM • Problems of UML and OCL • Large and complex • Inconsistent • Loose semantics • Difficult syntax of OCL • Key features of ZOOM • Simple and consistent • Familiar and easy syntax • Dual visual and textual representations • Extensive libraries

  39. A Simple ZOOM Structural Model Example Lexical elements --Very similar to Java/C#. namespace roster; @Entity struct Player { String playerId; String name; String position; double salary; } Types and variables -- Similar to Java, but more extensive. -- All basic Java data types are supported Expressions -- All Java expressions are valid in ZOOM Libraries -- Include common data types, collections (sets, lists, maps), and a lot more.

  40. MOF

  41. HRM

  42. Benefits of MDE • Reduced development time and cost • Increased portability, platform independence, cross-platform interoperability, and reusability • Improved application quality

  43. Model and Metamodel • Model A consistent and complete set of formal elements describing a system that is amenable to analysis • Metamodel A specification model for a system under study where such system under study is itself a valid model expressed in a certain modeling language

  44. Transformation Control Algorithm 1 Transform(node , RuleSet , Output_Model ) 2 rule <- findMatchingRule(node , RuleSet ) 3 targettext <- instantiate( rule .pre , node ) 4 OutPut_Model . append( targettext ) 5 foreach c is a child of node 6 transform(c , RuleSet , Output_Model ) 7 endforeach 8 targettext <- instantiate( rule .post , node ) 9 OutPut_Model . append( targettext ) Starting point: transform(root, RuleSet, Output_Model)

  45. Transformation Approaches • Direct-Manipulation Approach • Transformation using XSLT • Template-Based Approaches • QVT(Queries/Views/Transformations)

  46. Example struct Player { String playerId; String name; String position; double salary; }

  47. Example public class Player implements Serializable { @Entity Player (String id, String name, String position, double salary) { this.id = id; this.name = name; this.position = position; this.salary = salary; } @Id @Column(name = "id") public String getId() { return id; } … <Rule match="Struct"> <Mark> <Stereotype name="Entity"/> </Mark> <Pre> <![CDATA[ <File name="${name}.java"> … public class ${name} implements Serializable { <MacroRef name="${name}.constrDef"/> <MacroRef name="${name}.operDef"/> <MacroRef name="${name}.attrDef"/> } …

More Related