Presentation is loading. Please wait.

Presentation is loading. Please wait.

Model Transformation for End-Users

Similar presentations


Presentation on theme: "Model Transformation for End-Users"— Presentation transcript:

1 Model Transformation for End-Users
UA Computer Science Department July 28, 2009 Jeff Gray With Yu Sun (UAB) and Jules White (Vanderbilt) This work funded in part by NSF CAREER award CCF

2 Summary of Past Visits November 2001 January 2002 February 2005
“Applying Aspect-Oriented Techniques to Domain-Specific Modeling” January 2002 “Future Research Directions in Aspect-Oriented Programming” February 2005 “Transformations Across Software Artifacts” February 2009 (Robert Tairas) “Maintaining Cloned Software”

3 Invitation: Turing Award Speaker
Fran Allen 2006 Turing Award Winner and first woman to win the award September 14 at UAB “Is Computing at a Tipping Point?” Please send me an if you are interested in more details later

4 Model-Driven Engineering: Customized Languages with Domain-Specific Modeling

5 Categories of End-Users
Spreadsheet Admin Assistants Business Query Systems Businessperson Modeling Language Auto Factory Worker DSL for Physics Scientist

6 Observation “One size fits all” approach is appearing to be inadequate for many end-user needs Too complex and contains “kitchen sink” approach providing things most users do not need (UML) Current trend is to provide “domain-specific” modeling languages that are customized to a specific domain Notations and abstractions are exactly what the users expect; focused on problem space, not technology solution space But, how to create such modeling languages and environments? Expensive to create from scratch for each domain

7 Domain-Specific Modeling (DSM)
DSM involves systematic use of a graphical domain-specific language (DSL) to represent the various facets of a system DSM supports higher level abstractions, enabling domain experts to develop applications they want

8 Domain-Specific Modeling

9 Model-Driven Engineering (MDE)
MDE: specifies and generates software systems based on high-level models Domain-Specific Modeling (DSM): a paradigm of MDE that uses notations and rules from an application domain Metamodel: defines a Domain-specific Modeling language (DSML) by specifying the entities and their relationships in an application domain Model: an instance of the metamodel Model Transformation: a process that converts one or more models to various levels of software artifacts (e.g., other models, source code) The background of this research is MDE. During MDE, high-level models are promoted as the primary artifacts during the software development lifecycle. Models are used for software design, testing, implementation and maintenance. DSM is a paradigm of MDE that uses notations and rules from an application domain to define a domain – specific modeling language. Metamodeling is a process for defining domain-specific modeling languages (DSMLs). A metamodel formally defines the abstract syntax and static semantics of a DSM, just like the grammar of a programming language. A model is an instance of a metamodel, used to represent a system or part of a system. Model Transformation: A process that creates or modifies the target software artifacts (e.g. models, codes) from the source models. Vertical Transformation: Refinement across abstraction layers E.g., generating source code from models. Horizontal Transformation: Translation between models at the same level of abstraction E.g., model-to-model transformation. Commercial Examples: 1)Microsoft modeling tool 2)IBM modeling tool DSM: address the complexity of software development by raising the specification of software to visual models at a higher-level of abstraction and using notations and rules in an application domain.

10 Question But what is a model?

11 A very popular model: geographical maps (thanks to Jean Bezivin for this idea)
Models 1819 City Plan 2000 Census Map The System Aerial Map System Model repOf Road Map

12 Every map has a legend legend = metamodel Model c2 Metamodel

13 Another Notation (DSL)
Executable Model Music notation Power Tab Editor Metamodel c2 Model Sheet music Two Views: Traditional notes Guitar tab

14 Assisted Drawing Tools (e.g., MS/Visio)
c2 Model Metamodel

15 Schema definitions: Going “Meta”
Domain-Specific Modeling Programming Language Definition Database Schema Definition Schema definition Metamodel for a specific domain (e.g., Petri Net) Grammar for a specific language (e.g., Java) Table, constraint, and stored procedure definitions for a (e.g., payroll database) Schema instance Domain model (e.g., Petri Net model of a teller machine) A program written in a Specific language Intension of a database at a specific instance in time (e.g., the May 2009 payroll instance) Schema execution Model Interpreter Language compiler/interpreter Transactions and behavior of stored procedures in an executing application

16 Characteristics of Modeling Languages
Each model conforms to its metamodel A model is a representation of a system satisfying substitutability For each question that can be asked of the system, the model produces the same answer Not true for me and road maps! (from Jean Bezivin)

17 Background: Domain-Specific Modeling (cont’d)
M e t a m o d e l Metamodeling Interface Application Domain Environment Evolution Application Evolution Metamodel Definition App 1 App 2 App 3 DEFINE Meta-Level Translation Modeling Environment M o d e l Model Builder Model Interpretation Models INTERPRET I n t e r p r e t e r void CComponent::InvokeEx(CBuilder &buil der,CBuilderObject *focus, CBui lderObjectList &selected, long param) { CString DMSRoot = ""; DMSRoot = SelectFolder("Please Select DMS Root Folder:"); if (DMSRoot != "") { DMSRulePath = MSRuleApplierPath DMSRoot + RULESPATH + "Rules\\"; = DMSRoot + RULESPATH + "RuleApplier\\"; AfxMessageBox("DMSRulePath = " + DMSRulePath , MB_OK); OEPRoot = SelectFolder("Please Selec CString OEPRoot = ""; Model Interpreters The Generic Modeling Environment (GME) adopts the DSM approach and provides a plug-in mechanism for extension.

18 Example DSMLs and Applications
An application for a family entertainment center 1 2 An application for automotive manufacturing system 1 2 DuPont manufacturing system : the world's second largest chemical company Saturn manufacturing system Family entertainment system 1. Modeling 2. Stepwise model transformations

19 Model Transformation by Demonstration

20 Model Transformation (MT)
A core technology in DSM Model Evolution Code Generation Reverse Engineering Model Mapping

21 Model Transformation Example 1 UML to RDBMS
Simple UML Metamodel Simple RDBMS Metamodel Conforms to Conforms to Source UML Model Instance Target RDBMS Model Instance Transform To

22 Model Transformation Example 2 MazeGame Refactoring
MazeGame Metamodel Conforms to Conforms to Source Model Instance Target Model Instance Transform To Replace Monsters with Weapons

23 How to Implement Model Transformation?
Manual editing is tedious and error-prone Using GPL (e.g., Java, C++) is not efficient

24 Model Transformation Languages
Automate model transformations by programming QVT Query/View/Transformation C-SAW Constraint-Specification Aspect Weaver GReAT Graph Rewriting and Transformation Popular Model Transformation Languages

25 Model Transformation Languages NOT Perfect
Steep learning curve Deep understanding about Metamodel level definition Understand Metamodel First

26 Model Transformation Languages NOT Perfect
Steep learning curve Deep understanding about Metamodel level definition This is OK for computer scientists, but challenging for general users (e.g., domain experts) who can also contribute to some of the model transformation tasks

27 Model Transformation By Example (MTBE)
An innovative approach to simplify the implementation of model transformations

28 By Example Ideas Query By Example (QBE) Programming By Example (PBE)
XML Transformation By Example (XTBE) SELECT * FROM Contacts WHERE Name='Bob' AND State='TX'

29 Limitations of MTBE Semi-automatic rules generation
Users are not fully isolated from using the transformation languages The quality depends on available source and target models Only concept mapping. Cannot handle complex attribute transformation (e.g., arithmetic, string operations) Perfect Source and Target Models

30 Our Approach: Model Transformation By Demonstration (MTBD)
Ask users to demonstrate how the model transformation should be done An engine records user operations and infers the transformation pattern Reuse the generated pattern to new model instances

31 Generic Eclipse Modeling System
MT-Scribe The implementation of the MTBD idea is a plug-in to GEMS in Eclipse Assists in simplifying model transformation tasks GEMS Generic Eclipse Modeling System

32 Main Steps in MT-Scribe
Initial sequence of recorded operations Pattern Matching Backtracking Algorithm Edit a model instance to demonstrate how the transformation should be done 1. Demonstration 1. Recording 3. Infer Pattern 5. Correctness Checking 4. Reuse Pattern 2. Optimization

33 A Model Transformation Example
TASK: Replace the monster in a room with a weapon, and set the powerValue attribute of the new weapon to be half of the monster.

34 Demonstrate the Transformation
Step Operation 1 Select a Monster in a room 2 Delete the Monster 3 Add a new Weapon 4 Set the powerValue of the new Weapon

35 Operation Recording & Transformation Pattern Inference
Step Operation 1 Select a Monster in a room 2 Delete the Monster 3 Add a new Weapon 4 Set the powerValue of the new Weapon Optimize and Infer Pattern Step Operation Type Detail 1 Delete Element Root.MazeFolder.Room.Monster 2 Add Element Root.MazeFolder.Room (Weapon) 3 Update Element Root.MazeFolder.Room.Weapon.powerValue (Monster.powerValue / 2)

36 Reuse the Transformation Pattern
Traverse the model instance, find all the possible places where the recorded transformation could be done Backtracking Algorithm Re-execute the recorded operations in the new location with the new elements and properties Correctness checking avoids violating meta definitions

37 Current Status of MT-Scribe
Complete recording of all operations Recorded operation optimization Inference of transformation patterns Automatically match the pattern in new model instances Exact re-execution of transformation pattern Correctness checking and undo mechanism

38 Demonstration Video Demonstration of MTBD

39 Application 1 – Model Refactoring
UML Refactoring in C-SAW

40 Application 2 – Model Scalability
strategy traverseSites(n, i, m, j : integer) { declare id_str : string; if (i <= n) then id_str := intToString(i); rootFolder().findModel("NewGateway_Federation").findModel("Site " + id_str).addGateWay_r(m, j); traverseSites(n, i+1, m, j); endif; } //recursively add CORBA_Gateways to each existing site strategy addGateWay_r(m, j: integer) if (j<=m) then addGateWay(j); addGateWay_r(m, j+1); //add one CORBA_Gateway and connect it to Event_Channel strategy addGateWay(j: integer) declare ec, site_gw : object; id_str := intToString(j); addAtom("CORBA_Gateway", "CORBA_Gateway" + id_str); //create one CORBA_Gateway ec := findModel("Event_Channel"); site_gw := findAtom("CORBA_Gateway" + id_str); addConnection("LocalGateway_EC", site_gw, ec); Application 2 – Model Scalability Scale Up

41 Application 3 – Aspect-Oriented Modeling
self.assignTo() = processor0 strategy Assign(limit : integer){ declare static accumulateWCET, processNum : integer; declare currentWCET : integer; self.compute.WCET.getInt(currentWCET); accumulateWCET := accumulateWCET + currentWCET; if (limit < accumulateWCET) then accumulateWCET := currentWCET; processNum := processNum + 1; endif; <<CComBSTR aConstraint = "self.assignTo()=processor" + XMLParser::itos(processNum); >> AddConstraint("ProcessConstraint", aConstraint); }

42 Future Work Enable more specific precondition inference
Enable more powerful and rich attribute transformation (e.g., max(), min()) Implement exogenous model transformations

43 Questions & Comments ? Additional questions:
More examples and video demos available at: Additional questions: This work funded in part by NSF CAREER award CCF


Download ppt "Model Transformation for End-Users"

Similar presentations


Ads by Google