Devon M. Simmonds Computer Science Department University of North Carolina, Wilmington

Post on 25-Jan-2016

40 views 0 download

description

The Directive-Based Transformation Language (DBTL). Devon M. Simmonds Computer Science Department University of North Carolina, Wilmington simmondsd@uncw.edu August 19, 2008. Software Development. Simple Tools. International Space Station. Power Tools. - PowerPoint PPT Presentation

Transcript of Devon M. Simmonds Computer Science Department University of North Carolina, Wilmington

Devon M. Simmonds Computer Science Department, CSC592 1

Devon M. SimmondsComputer Science Department

University of North Carolina, Wilmingtonsimmondsd@uncw.edu

August 19, 2008

The Directive-Based Transformation

Language (DBTL)

Devon M. Simmonds Computer Science Department, CSC592 2

Software Development

Simple Tools

Power Tools

Blueprints

International Space Station

International Airport Baggage Handling System

Devon M. Simmonds Computer Science Department, CSC592 3

Models in Engineering

• Benefits of models– Help us understand and manage complex systems

– Communicate understanding

– Drive implementation

– Save resources

Need to improve the use of models in software development!

Devon M. Simmonds Computer Science Department, CSC592 4

4

Model Model AAModel Model AA

AAAA

BBBBCCCC

Model Model CCModel Model CC

Model Transformation

ModelModel B BModelModel B B

MMMM

AAAA

PPPPKKKK

Transformation

Devon M. Simmonds Computer Science Department, CSC592 5

Model-Driven Engineering (MDE)

CodeCodeCodeCode

CreateCreateModelModel

ModelModel of the Program of the ProgramModelModel of the Program of the Program

AAAA

BBBBCCCC

SC_MODULE(producer){sc_outmaster<int> out1;sc_in<bool> start; // kick-startvoid generate_data (){for(int i =0; i <10; i++) {out1 =i ; //to invoke slave;}}SC_CTOR(producer){SC_METHOD(generate_data);sensitive << start;}};SC_MODULE(consumer){sc_inslave<int> in1;int sum; // state variablevoid accumulate (){sum += in1;cout << “Sum = “ << sum << endl;}

CompileCompileModelModel

CompileCompileCodeCode

Binary instructionsBinary instructionsBinary instructionsBinary instructionsSC_MODULE(producer){sc_outmaster<int> out1;sc_in<bool> start; // kick-startvoid generate_data (){for(int i =0; i <10; i++) {out1 =i ; //to invoke slave;}}SC_CTOR(producer){SC_METHOD(generate_data);sensitive << start;}};SC_MODULE(consumer){sc_inslave<int> in1;int sum; // state variablevoid accumulate (){sum += in1;cout << “Sum = “ << sum << endl;}

Code-centric Development

ManuallyManually

Create CodeCreate Code

• Realizing the dream – MDD challenges– Model Specification– Model Transformation

• Model to model• Model to code

– Managing technologies– Model Analysis

Devon M. Simmonds Computer Science Department, CSC592 6

6

Transformation Languages

• Needed to support MDE!

ModelModel B BModelModel B B

MMMM

BBBBCCCC

AAAA

PPPPKKKK

Project #4

Devon M. Simmonds Computer Science Department, CSC592 7

7

class Department { private:          char name[40]; Student csc[100];public:     void manageStudents(){ csc[i]->register(); csc[i]->grade(); csc[i]->graduate();}}

Generating code from aspect-oriented design models

Project #5

:Student:Department

takeCourse()

takeCourse()

graduate()

Devon M. Simmonds Computer Science Department, CSC592 8

8

Model-to-model Transformation Conceptual

Model

Source Pattern

Transformation Schema

Interpreter

Target Pattern

Devon M. Simmonds Computer Science Department, CSC592 9

The Directive-Based Transformation Language

• Source pattern– Describes valid input models

• Transformation schema– Describes transformation to change

input model to output model– Transformations are specified using five

directives.

Devon M. Simmonds Computer Science Department, CSC592 10

|Participant

|participantOp(|a:|Ptype-1, |b:|Ptype-2)|manageUser

*

|TransactionManager

|clientID:String|serviceID:String

|transOperation(|param1:||Type1, |param2:Type2)

source.|TransactionManager

new |transState:String

redefine |clientID:String{name=Integer}

source.|Participant

new commit()

new abort()

handlesParticipant

0..1*new |getState():Boolean

new commit()

new abort()

*

MoneyTransferService

transID:String

serviceID:String

AccountManager

deposit(a:Account, amt:float)

withdraw(a:Account, amt:float)

handlesParticipant

0..1*

moneyTransfer(a:Account , b:Account, amt:float)

• Source Model

• Source Pattern

• Transformation Schema

Devon M. Simmonds Computer Science Department, CSC592 11

A Transformation Schema

Devon M. Simmonds Computer Science Department, CSC592 12

Transformation Directives

• The source directive– Copy model elements

• The name directive– Supply platform-specific name

• The redefine directive– Modify copied elements

• The new directive– Create new model elements

• The exclude directive– Eliminate model elements

Devon M. Simmonds Computer Science Department, CSC592 13

The source Directive

Devon M. Simmonds Computer Science Department, CSC592 14

The rename Directive

Devon M. Simmonds Computer Science Department, CSC592 15

The exclude, new & edefine Directives

Devon M. Simmonds Computer Science Department, CSC592 16

The source Directive

Devon M. Simmonds Computer Science Department, CSC592 17

The source Directive

Devon M. Simmonds Computer Science Department, CSC592 18

DBTL Model transformation Process

Devon M. Simmonds Computer Science Department, CSC592 19

Q u e s t i o n s ?

The End

Devon M. Simmonds, Computer Science Department, University of North Carolina Wilmington