Model Driven Development (MDD) Devon M. Simmonds Computer Science Department UNCW...

99
Model Driven Development (MDD) Devon M. Simmonds Computer Science Department UNCW simmondsd[at]uncw.edu http://people.uncw.edu/simmondsd/ _______________________________________________________

Transcript of Model Driven Development (MDD) Devon M. Simmonds Computer Science Department UNCW...

Page 1: Model Driven Development (MDD) Devon M. Simmonds Computer Science Department UNCW simmondsd[at]uncw.edu  _______________________________________________________.

Model Driven Development (MDD)

Devon M. SimmondsComputer Science Department

UNCW

simmondsd[at]uncw.edu

http://people.uncw.edu/simmondsd/_______________________________________________________

Page 2: Model Driven Development (MDD) Devon M. Simmonds Computer Science Department UNCW simmondsd[at]uncw.edu  _______________________________________________________.

Problems in software developmentThe role of modelsModel driven development (MDD)MDD principles/challengesSummary

Overview

2

Page 3: Model Driven Development (MDD) Devon M. Simmonds Computer Science Department UNCW simmondsd[at]uncw.edu  _______________________________________________________.

3

Many Problems Interesting Jokes.

Building Large Complex Software is Difficult!

“Witness testifies on Software Speed"

Page 4: Model Driven Development (MDD) Devon M. Simmonds Computer Science Department UNCW simmondsd[at]uncw.edu  _______________________________________________________.

4

Many Problems Interesting Jokes.

Building Large Complex Software is Difficult!

“Witness Testifies on Software Security"

Page 5: Model Driven Development (MDD) Devon M. Simmonds Computer Science Department UNCW simmondsd[at]uncw.edu  _______________________________________________________.

5

Amid all the jokes, we are

in the business of

finding solutions!

Building Large Complex Software is Difficult!

Page 6: Model Driven Development (MDD) Devon M. Simmonds Computer Science Department UNCW simmondsd[at]uncw.edu  _______________________________________________________.

6

Making The Case For

Model-Driven Engineering

Page 7: Model Driven Development (MDD) Devon M. Simmonds Computer Science Department UNCW simmondsd[at]uncw.edu  _______________________________________________________.

7

Computer science - solving problems with the aid of a computer– Software engineering – systematic approach to

creating complex software systems using teams.

Motivation

Computer software is ubiquitous!

Page 8: Model Driven Development (MDD) Devon M. Simmonds Computer Science Department UNCW simmondsd[at]uncw.edu  _______________________________________________________.

Models can help

Code-centric software development introduces Accidental complexity

• Unnecessary complexity introduced by a technology or method– building construction without using power tools

– Essential complexity: inherent in the problem and cannot be eliminated• making airplanes fly

8

Page 9: Model Driven Development (MDD) Devon M. Simmonds Computer Science Department UNCW simmondsd[at]uncw.edu  _______________________________________________________.

What is a model?

A model is a representation of a system

A model does not show all the featuresA model is an abstraction– Abstraction = hide details

9

Page 10: Model Driven Development (MDD) Devon M. Simmonds Computer Science Department UNCW simmondsd[at]uncw.edu  _______________________________________________________.

How Engineering Models are Used

To help us understand and manage complex systems– Focus on essential complexity– Define different views

To communicate understanding– Clients, users, implementers, testers, etc.

To drive implementation– The model as a blueprint for construction

Save resources – Identify problems before the item is put into production.

Engineering is a Model-Driven Discipline!10

Page 11: Model Driven Development (MDD) Devon M. Simmonds Computer Science Department UNCW simmondsd[at]uncw.edu  _______________________________________________________.

Characteristics of Useful Models

Abstract• Emphasize important aspects while removing irrelevant ones

Understandable• Expressed in a form that is readily understood by observers

Accurate• Faithfully represents the modeled system

Predictive• Can be used to answer questions about the modeled system

Inexpensive• Much cheaper to construct and study than the modeled system

11

Page 12: Model Driven Development (MDD) Devon M. Simmonds Computer Science Department UNCW simmondsd[at]uncw.edu  _______________________________________________________.

Models in Software Engineering

UML– Use cases– Activity diagrams– State diagrams– Sequence diagrams– Class diagrams– Package diagrams– Etc.

• OCL to specify constraints

12

Page 13: Model Driven Development (MDD) Devon M. Simmonds Computer Science Department UNCW simmondsd[at]uncw.edu  _______________________________________________________.

Views

An view is a simplified description (an abstraction) of a system from a particular perspective or vantage point, covering particular concerns, and omitting entities that are not relevant to this perspective.

13

Page 14: Model Driven Development (MDD) Devon M. Simmonds Computer Science Department UNCW simmondsd[at]uncw.edu  _______________________________________________________.

Diagrams

A diagram is a view into a model– Presented from the aspect of a particular stakeholder– Provides a partial representation of the system– Is semantically consistent with other views

UML diagrams– Static views: use case, class, object, component, deployment– Dynamic views: sequence, statechart, activity

14

Page 15: Model Driven Development (MDD) Devon M. Simmonds Computer Science Department UNCW simmondsd[at]uncw.edu  _______________________________________________________.

Models, Views, and Diagrams

ScenarioDiagramsScenario

DiagramsCollaborationDiagrams

StateDiagramsState

DiagramsComponentDiagrams

ComponentDiagramsComponent

DiagramsDeploymentDiagrams

StateDiagramsState

DiagramsObjectDiagrams

ScenarioDiagramsScenario

DiagramsStatechartDiagrams

Use CaseDiagramsUse Case

DiagramsSequenceDiagrams

StateDiagramsState

DiagramsClassDiagrams

ActivityDiagrams

A model is a complete description of a system from a particular perspective

Models

15

Use CaseDiagramsUse Case

DiagramsUse CaseDiagrams

Page 16: Model Driven Development (MDD) Devon M. Simmonds Computer Science Department UNCW simmondsd[at]uncw.edu  _______________________________________________________.

16

The 4 + 1 View Model – Philippe Kruchten(95)

Logical viewEnd-user Functionality

Development viewProgrammers .Software management

Physical viewSystem topology,

Delivery, installation

Process viewSystem integrators:Performance, Scalability, Throughput

Conceptual Physical

Use case view

Page 17: Model Driven Development (MDD) Devon M. Simmonds Computer Science Department UNCW simmondsd[at]uncw.edu  _______________________________________________________.

17

Transforming System Views

UML models present different views of systemsEvolution of system effected by evolving models (views)– Requires well defined relationships between models– requires well defined notions of

refinement/abstraction

Page 18: Model Driven Development (MDD) Devon M. Simmonds Computer Science Department UNCW simmondsd[at]uncw.edu  _______________________________________________________.

Class Diagram Practice ExerciseCreate a class diagram using the problem description below. – A school video library tracking system is to be developed. Videos can be scientific,

religious or general. General videos are classified as miscellaneous, sports or entertainment. Students and professors can belong to research groups. A research group must have at least 2 professors. Every student must belong to some research group. Professors that belong to a research group are called research professors. Research professors do not teach courses every semester. Each semester, a student must register for at least one course offered by a professor in his research group. A student cannot register for courses outside the subject areas of the research groups in his academic department. A research group can consist of members with various subject area interests. However, subject areas are only classified as an area of interest for the group if at least two members have interest in the area. In general, professors can check out any number of videos, however, visiting professors can check out at most seven videos. Unlike regular professors, visiting professors can check out videos for the duration of only two weeks. Students can check out any number of religious videos and at most 2 scientific videos. Students can check out only scientific videos in the subject areas represented in their research groups. 18

Page 19: Model Driven Development (MDD) Devon M. Simmonds Computer Science Department UNCW simmondsd[at]uncw.edu  _______________________________________________________.

19

What is Model-Driven Development (MDD)?

Models are the primary software development artifactsMDD involves– modeling software products and processes– precisely defining relationships among models– transforming models to executable forms

Page 20: Model Driven Development (MDD) Devon M. Simmonds Computer Science Department UNCW simmondsd[at]uncw.edu  _______________________________________________________.

Model Driven Engineering

CreateModel

Model AModel A

AA

BBCC

Model BModel B

MM

BBCC

AA

PPKK

. . Model Properties

CodeCodeSC_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;}

Transform/Compile

Analyze

20

Page 21: Model Driven Development (MDD) Devon M. Simmonds Computer Science Department UNCW simmondsd[at]uncw.edu  _______________________________________________________.

Model Driven Engineering

CreateModel

Model AModel A

AA

BBCC

Model BModel B

MM

BBCC

AA

PPKK

. .

• Challenges– Abstraction: specifying

models– Automation: transforming

models, compiling models (e.g., code generation)

– Analysis: determining properties of models

– Evolution/Reuse: Changing and using models for developing other applications

Model Properties

CodeCodeSC_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;}

Transform/Compile

Analyze

21

Page 22: Model Driven Development (MDD) Devon M. Simmonds Computer Science Department UNCW simmondsd[at]uncw.edu  _______________________________________________________.

The Abstraction Challenge: Specifying Models

Can we build an analyzable language for modeling software systems at a level of abstraction above the current high-level programming languages?

22

Page 23: Model Driven Development (MDD) Devon M. Simmonds Computer Science Department UNCW simmondsd[at]uncw.edu  _______________________________________________________.

The Abstraction Challenge: UML Class diagram view

class Person { private:       int age;      char name[40]; Department dept;public:     void move();      void speak();}

class Student: public Person {private: char id[20], grades[20], courses[20][20];public: char major[20];     void takeCourse()      void graduate()}

Department

Class diagram view shows structure and relationships

Person-age:int-name:String[40]

+move()+speak()

Student

+takeCourse()+graduate()

-id:String[20]-grades:String[20]-courses:String[20]+major:String

23

Page 24: Model Driven Development (MDD) Devon M. Simmonds Computer Science Department UNCW simmondsd[at]uncw.edu  _______________________________________________________.

class Person { private:       int age;      char name[40]; Department dept;public:     void move();      void speak();}

class Student: public Person {private: char id[20], grades[20], courses[20][20];public: char major[20];     void takeCourse()      void graduate()}

:Student:Department

takeCourse()

takeCourse()

graduate()

Interaction diagram view shows how classes interact

The Abstraction Challenge: UML Interaction diagram view

24

Page 25: Model Driven Development (MDD) Devon M. Simmonds Computer Science Department UNCW simmondsd[at]uncw.edu  _______________________________________________________.

The Automation ChallengePerson

-age:int-name:String[40]-address:Address+move()+speak()

• Code Generation• generating code from

models, i.e. compiling models.

• Managing Technologies• supporting model portability,

reusability, etc.• Current Tools

• OptimalJ, Bridgepoint, XDE, etc.

• Model Transformation• creating new models from

existing models

25

Page 26: Model Driven Development (MDD) Devon M. Simmonds Computer Science Department UNCW simmondsd[at]uncw.edu  _______________________________________________________.

26

Code Generation

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

Model BModel B

MM

BBCC

AA

PPKK

Altova UModel

Page 27: Model Driven Development (MDD) Devon M. Simmonds Computer Science Department UNCW simmondsd[at]uncw.edu  _______________________________________________________.

Distributed Systems Development

Computer Hardware

Operating System

Application program

Computer Hardware

Operating System

Application program

Transaction management

Fault toleranceSecurityNamingConcurrencyReplicationQueryEventQuality of service

Middleware

Application program

Realizing The Dream – Managing Technologies

27

Page 28: Model Driven Development (MDD) Devon M. Simmonds Computer Science Department UNCW simmondsd[at]uncw.edu  _______________________________________________________.

Middleware Transparencies

Services provided to distributed systems. – Access transparency: local and remote resources are accessed using

identical operations. – Location transparency: resources are accessed without knowledge of

their location (location independence).– Concurrency transparency: processes can operate concurrently using

shared resources without interference between them.– Replication transparency: duplication of resources unknown to users.

Resources are usually duplicated for purposes of reliability and performance.

– Failure transparency: faults are concealed, allowing application programs to complete their tasks despite the failure of hardware or software components.

28

Page 29: Model Driven Development (MDD) Devon M. Simmonds Computer Science Department UNCW simmondsd[at]uncw.edu  _______________________________________________________.

Standard Middleware Services

EventTransactionQuality of service (QoS)NamingQuerySecurityMethod invocationEtc.

29

Page 30: Model Driven Development (MDD) Devon M. Simmonds Computer Science Department UNCW simmondsd[at]uncw.edu  _______________________________________________________.

Distributed Systems Development Context

Many middleware technologies– CORBA, Jini, .Net, EJB, SOAP, COM

Problems require many technologiesMiddleware technologies evolveMiddleware technology is crosscutting

30

Page 31: Model Driven Development (MDD) Devon M. Simmonds Computer Science Department UNCW simmondsd[at]uncw.edu  _______________________________________________________.

Distributed Systems Development Problem

Coupling of applications + technologies– Changes in middleware change in application – Coupling results in complexity

Difficult to develop and evolve distributed applications

Specify models and transformations Migrate distributed applications

31

Page 32: Model Driven Development (MDD) Devon M. Simmonds Computer Science Department UNCW simmondsd[at]uncw.edu  _______________________________________________________.

Difficult to Specify Design Models

ClassA

ClassB

Middleware features

ClassC

ClassB

ClassAClassC

Distributed Application

Complex Model

Transformation

Transformed model or code

Difficult to Specify Transformations

Distributed Application

32

Page 33: Model Driven Development (MDD) Devon M. Simmonds Computer Science Department UNCW simmondsd[at]uncw.edu  _______________________________________________________.

Difficulties To Migrate Distributed Application

EliminateOld

Middleware

Refactor Application

Integrate New Middleware

….

..

ClassA

ClassB

ClassCDistributed Application

ClassA

ClassB

ClassCPIM

ClassA

ClassDClassB

ClassCClassA

ClassDClassB

ClassC

New Distributed Application

33

Page 34: Model Driven Development (MDD) Devon M. Simmonds Computer Science Department UNCW simmondsd[at]uncw.edu  _______________________________________________________.

The Automation ChallengePerson

-age:int-name:String[40]-address:Address+move()+speak()

• Code Generation• generating code from

models, i.e. compiling models.

• Managing Technologies• supporting model portability,

reusability, etc.• Current Tools

• OptimalJ, Bridgepoint, XDE, etc.

• Model Transformation• creating new models from

existing models

34

Page 35: Model Driven Development (MDD) Devon M. Simmonds Computer Science Department UNCW simmondsd[at]uncw.edu  _______________________________________________________.

35Some slides by Robert B. France, CSU

Defining & Using TransformationsPerson

-age:int-name:String[40]-address:Address+move()+speak()

• Code Generation• generating code from

models, i.e. compiling models.

• Managing Technologies• supporting model portability,

reusability, etc.• Current Tools

• OptimalJ, Bridgepoint, XDE, etc.

• Model Transformation• creating new models from

existing models

Page 36: Model Driven Development (MDD) Devon M. Simmonds Computer Science Department UNCW simmondsd[at]uncw.edu  _______________________________________________________.

Outline

IntroductionQuery, View Transformation OverviewTransformation challengesMapping models to code and vice versaExperiences & Lessons learned

36

Page 37: Model Driven Development (MDD) Devon M. Simmonds Computer Science Department UNCW simmondsd[at]uncw.edu  _______________________________________________________.

37

Model to Model Transformation

CreateModel

Model AModel A

AA

BBCC

Model BModel B

MM

BBCC

AA

PPKK

Page 38: Model Driven Development (MDD) Devon M. Simmonds Computer Science Department UNCW simmondsd[at]uncw.edu  _______________________________________________________.

38

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

Model BModel B

MM

BBCC

AA

PPKK

Model to Code Transformation - code generation

Page 39: Model Driven Development (MDD) Devon M. Simmonds Computer Science Department UNCW simmondsd[at]uncw.edu  _______________________________________________________.

39

Are transformations the heart of MDE?

MDE = models + transformationsTransformation-driven development?– Specify models– Evolve models

Model BModel B

MM

BBCC

AA

PPKK

Page 40: Model Driven Development (MDD) Devon M. Simmonds Computer Science Department UNCW simmondsd[at]uncw.edu  _______________________________________________________.

40

Potential Transformation Goals

Refinement/Realization: e.g., create design models from analysis models. Abstraction: e.g., gain understanding of an existing artifact or model by abstracting out irrelevant details.Inferencing: e.g., transforming a model to make implied properties explicit.Analyzing: e.g., transforming a model to make it amenable to particular forms of analysis.Refactoring: e.g., transforming a model to improve its evolvability.

Page 41: Model Driven Development (MDD) Devon M. Simmonds Computer Science Department UNCW simmondsd[at]uncw.edu  _______________________________________________________.

Classes of Transformations

Vertical transformations (e.g., realize design in code, refine design features)Horizontal transformations (e.g., refactor to change features or enhance design quality, transform descriptive models to analysis models)

41

Page 42: Model Driven Development (MDD) Devon M. Simmonds Computer Science Department UNCW simmondsd[at]uncw.edu  _______________________________________________________.

42

Vertical Transformations

Refinement/Realization– Realization example: transforming detailed design models to

code– Refinement example: transforming abstract designs to less

abstract designs

Abstraction– Example: reverse-engineering of code to design

Page 43: Model Driven Development (MDD) Devon M. Simmonds Computer Science Department UNCW simmondsd[at]uncw.edu  _______________________________________________________.

43

Horizontal Transformations

Refactoring: Improving model quality– E.g., applying patterns to designs

• Requires precise representation of patterns

Inferencing: Inferring properties from modelsAnalyzing: Extracting information needed for analysisComposition/anti-composition

Page 44: Model Driven Development (MDD) Devon M. Simmonds Computer Science Department UNCW simmondsd[at]uncw.edu  _______________________________________________________.

44

Refactoring and Realization Example

Page 45: Model Driven Development (MDD) Devon M. Simmonds Computer Science Department UNCW simmondsd[at]uncw.edu  _______________________________________________________.

45

Simple Model Inferencing Example (work of A. Evans et al.)

A

B C

Dm..n

p..q

DDp..q

*

*

p..q

Rel

Rel01

Rel02

Rel01 Rel02 Rel

A

B C

Dm..n

p..q

Rel

Page 46: Model Driven Development (MDD) Devon M. Simmonds Computer Science Department UNCW simmondsd[at]uncw.edu  _______________________________________________________.

46

Transformation Conceptual Model

Rigorous Analysis• static analysis• dynamic analysis

feedbackfeedback

based on

TransformationMetamodelSource Metamodel

conforms to

Source Model

Target Metamodel

conforms to

Target Model

feedback

Transformation

Page 47: Model Driven Development (MDD) Devon M. Simmonds Computer Science Department UNCW simmondsd[at]uncw.edu  _______________________________________________________.

47

Example

UML ModelFormal ModelFormalization

feedback

UML MetamodelFormal Language Metamodel

conforms toconforms to

based on

UML-FLMetamodel

Page 48: Model Driven Development (MDD) Devon M. Simmonds Computer Science Department UNCW simmondsd[at]uncw.edu  _______________________________________________________.

Query, View, Transformation Standard

Page 49: Model Driven Development (MDD) Devon M. Simmonds Computer Science Department UNCW simmondsd[at]uncw.edu  _______________________________________________________.

49

Query View Transformation Standard

Standard language-based concepts for specifying and implementing transformationsBased on best available experience (!)– and other concerns …

Supports hybrid declarative, imperative styles

Page 50: Model Driven Development (MDD) Devon M. Simmonds Computer Science Department UNCW simmondsd[at]uncw.edu  _______________________________________________________.

50

QVT Structure

Declarative section– transformations specified as relationships among modeling structures

(MOF models)– Provides support for specifying patterns (as object template expressions)

and for pattern matchingImperative section– Provides a standard language for describing implementations of relations

as Mapping Operations• A transformation described entirely by Mapping Operations is called an

operational transformation– Provides support for using non-standard implementation operators for

realizing relations

Page 51: Model Driven Development (MDD) Devon M. Simmonds Computer Science Department UNCW simmondsd[at]uncw.edu  _______________________________________________________.

51

QVT Transformation Language

A user-friendly Relations metamodel and language which supports complex object pattern matching and object tem-plate creation.

A Core metamodel and language defined using minimal extensions to EMOF and OCL.

MOF Operations may be derived from Relations making it possible to "plug-in" any implementation of a MOF Operation with the same signature.

Page 52: Model Driven Development (MDD) Devon M. Simmonds Computer Science Department UNCW simmondsd[at]uncw.edu  _______________________________________________________.

52

QVT Transformation ExampleSimple UML meta-model

Page 53: Model Driven Development (MDD) Devon M. Simmonds Computer Science Department UNCW simmondsd[at]uncw.edu  _______________________________________________________.

53

Simple RDBMS meta-model

Page 54: Model Driven Development (MDD) Devon M. Simmonds Computer Science Department UNCW simmondsd[at]uncw.edu  _______________________________________________________.

54

Graphical Representation

relation UML2Rel {

checkonly domain uml1 c:Class {name = n, attribute = a:Attribute{name = an}}

checkonly domain r1 t:Table {name = n, column = col:Column{name = an}}

}

Source model Target model

Page 55: Model Driven Development (MDD) Devon M. Simmonds Computer Science Department UNCW simmondsd[at]uncw.edu  _______________________________________________________.

55

Transformation specification Conceptual Model

based on

TransformationMetamodelSource Metamodel

conforms to

Source Model

Target Metamodel

conforms to

Target Model

feedback

TransformationEngine

Input Model Output Model

conforms to conforms to

Page 56: Model Driven Development (MDD) Devon M. Simmonds Computer Science Department UNCW simmondsd[at]uncw.edu  _______________________________________________________.

56

relation PackageToSchema { ckeckonly domain uml p:Package {name=pn} enforce domain rdbms s:Schema {name=pn}

}

Page 57: Model Driven Development (MDD) Devon M. Simmonds Computer Science Department UNCW simmondsd[at]uncw.edu  _______________________________________________________.

57

Graphical Representation

Page 58: Model Driven Development (MDD) Devon M. Simmonds Computer Science Department UNCW simmondsd[at]uncw.edu  _______________________________________________________.

58

Simple RDBMS meta-model

The when clause specifies the conditions under which the relationship needs to hold, so the relation ClassToTable needs to hold only when the PackageToSchema relation holds

The where clause specifies the condition that must be satisfied by all model elements participating in the relation

Page 59: Model Driven Development (MDD) Devon M. Simmonds Computer Science Department UNCW simmondsd[at]uncw.edu  _______________________________________________________.

59

Simple RDBMS meta-model

Page 60: Model Driven Development (MDD) Devon M. Simmonds Computer Science Department UNCW simmondsd[at]uncw.edu  _______________________________________________________.

In Class Exercise

Create a QVT transformation for converting a sequence diagram to a class model.

60

Page 61: Model Driven Development (MDD) Devon M. Simmonds Computer Science Department UNCW simmondsd[at]uncw.edu  _______________________________________________________.

61

QVT Transformation Example

Transformation model

Input model

Page 62: Model Driven Development (MDD) Devon M. Simmonds Computer Science Department UNCW simmondsd[at]uncw.edu  _______________________________________________________.

62

QVT Transaction Example

Transformation model

Source transformation model

Page 63: Model Driven Development (MDD) Devon M. Simmonds Computer Science Department UNCW simmondsd[at]uncw.edu  _______________________________________________________.

63

QVT Transformation Example

Target transformation model (part a)

Page 64: Model Driven Development (MDD) Devon M. Simmonds Computer Science Department UNCW simmondsd[at]uncw.edu  _______________________________________________________.

64

QVT Transformation Example

Target model (part b)

Page 65: Model Driven Development (MDD) Devon M. Simmonds Computer Science Department UNCW simmondsd[at]uncw.edu  _______________________________________________________.

65

QVT Transformation Example

Target model (part c)

Page 66: Model Driven Development (MDD) Devon M. Simmonds Computer Science Department UNCW simmondsd[at]uncw.edu  _______________________________________________________.

66

The Model-Driven Architecture (MDA)Person

-age:int-name:String[40]-address:Address+move()+speak()

• Code Generation• generating code from

models, i.e. compiling models.

• Managing Technologies• supporting model portability,

reusability, etc.• Current Tools

• OptimalJ, Bridgepoint, XDE, etc.

• Model Transformation• creating new models from

existing models

Slides include some created by Richard Mark Soley

Page 67: Model Driven Development (MDD) Devon M. Simmonds Computer Science Department UNCW simmondsd[at]uncw.edu  _______________________________________________________.

67

Devon M. Simmonds

Introduction to the Model-Driven Architecture (MDA)

Slides include some created by Richard Mark Soley

Page 68: Model Driven Development (MDD) Devon M. Simmonds Computer Science Department UNCW simmondsd[at]uncw.edu  _______________________________________________________.

68

Outline

Software contextThe OMGThe MDA

Page 69: Model Driven Development (MDD) Devon M. Simmonds Computer Science Department UNCW simmondsd[at]uncw.edu  _______________________________________________________.

Current Software Context

Heterogeneity is permanentProblems require many technologiesMiddleware technologies constantly changeMiddleware technology is crosscutting

69

Page 70: Model Driven Development (MDD) Devon M. Simmonds Computer Science Department UNCW simmondsd[at]uncw.edu  _______________________________________________________.

Heterogeneity is Permanent

Programming languages– ~2 million COBOL programmers

• 200 billion lines of Cobol code exist in enterprises– ~1.6 million VB programmers– ~1.1 million C/C++ programmers

Operating systems– Unix, MVS, VMS, MacOS, Windows (all 8!), PalmOS…– Windows 3.1: it’s still out there!– Embedded devices (mobile, set-top, etc.)

Networks– Ethernet, ATM, IP, SS7, Firewire, USB– Bluetooth, 802.11b, HomeRF

Middleware technologies– CORBA, Jini, .Net, EJB, SOAP, COM 70

Page 71: Model Driven Development (MDD) Devon M. Simmonds Computer Science Department UNCW simmondsd[at]uncw.edu  _______________________________________________________.

Problems Require Many Technologies

Multiple OSMultiple programming languagesEtc.

71CSC550 Software Engineering

Page 72: Model Driven Development (MDD) Devon M. Simmonds Computer Science Department UNCW simmondsd[at]uncw.edu  _______________________________________________________.

Technologies Constantly Change

Middleware technology is crosscutting!

Middleware itself has proliferated: CORBA®: Vendor, OS & language

independent middleware COM/DCOM/MTS Java/EJB XML/SOAP C#/.Net What will be Next Best Thing?

72

Page 74: Model Driven Development (MDD) Devon M. Simmonds Computer Science Department UNCW simmondsd[at]uncw.edu  _______________________________________________________.

Protecting Software Investment?

Tracking the next best thingProtecting your investment in existing software baseRetaining qualified staffMaintaining existing code base

Integrating what you’ve built– With what you will build!

74

Page 75: Model Driven Development (MDD) Devon M. Simmonds Computer Science Department UNCW simmondsd[at]uncw.edu  _______________________________________________________.

Where Can We Agree?

There will not be consensus on hardware platformsThere will not be consensus on operating systemsThere will not be consensus on network protocolsThere will not be consensus on programming languages

There must be consensus on interfaces and interoperability!

OMG to the rescue! 75

Page 76: Model Driven Development (MDD) Devon M. Simmonds Computer Science Department UNCW simmondsd[at]uncw.edu  _______________________________________________________.

The Object Management Group (OMG)

“The OMG is an international not-for-profit software consortium that is setting standards in the area of distributed object computing. We are a vendor-neutral membership-driven organization and have hundreds of members who are working towards developing and refining these standards.” - OMG Website

76

Page 77: Model Driven Development (MDD) Devon M. Simmonds Computer Science Department UNCW simmondsd[at]uncw.edu  _______________________________________________________.

Who Are OMG?

AT&T

BEA

Borland

Boeing

CA

Citigroup

Compaq

Compuware

Ericsson

Ford

Fujitsu

Glaxo SmithKline

Hewlett Packard

Hitachi

Hyperion

IBM

IONA

io Software

Kabira

Kennedy Carter

John Deere

Microsoft

MITRE

MSC.Software

NASA

NEC

NetGenics

NTT

OASIS

Oracle

Pfizer

Rational

SAGA Software

SAP

SAS Institute

Secant

Siemens

Sprint

Sun

Unisys

Vertel

77

Page 78: Model Driven Development (MDD) Devon M. Simmonds Computer Science Department UNCW simmondsd[at]uncw.edu  _______________________________________________________.

OMG’s Major Successes

Common Object Request Broker Architecture– CORBA® remains the only language- and platform-neutral interoperability standard

Unified Modeling Language– UMLTM remains the world’s only standardized modeling language

Common Warehouse Metamodel– CWMTM, the integration of the last two data warehousing initiatives

Meta-Object Facility– MOFTM, the repository standard

XML Metadata Interchange– XMITM, the XML-UML standard

78

Page 79: Model Driven Development (MDD) Devon M. Simmonds Computer Science Department UNCW simmondsd[at]uncw.edu  _______________________________________________________.

OMG & The Technology Change Problem

Goal Help organizations ensure that their mission-critical information systems are rooted in standards that will adapt to new hardware capabilities and software platforms.Provide a vendor-neutral approach to the challenge of business and technology change.

79

Page 80: Model Driven Development (MDD) Devon M. Simmonds Computer Science Department UNCW simmondsd[at]uncw.edu  _______________________________________________________.

OMG’s Solution

Develop an architecture, using object technology, for distributed application integration, guaranteeing:– reusability of components– interoperability & portability– basis in commercially available software

80

Page 81: Model Driven Development (MDD) Devon M. Simmonds Computer Science Department UNCW simmondsd[at]uncw.edu  _______________________________________________________.

81

Model Driven Architecture (MDA)

[From OMG website]

An initiative to address pervasive middleware features

Make models 1st class entities.

Create technology-based models separate from business logic models.

Support automated transformation of models

Modeling in UML

[From OMG website]

Page 82: Model Driven Development (MDD) Devon M. Simmonds Computer Science Department UNCW simmondsd[at]uncw.edu  _______________________________________________________.

MDA Goals

– Portability– Interoperability– Reusability– Platform Independence– Reduction in complexity

• Model to model transformations

82

Page 83: Model Driven Development (MDD) Devon M. Simmonds Computer Science Department UNCW simmondsd[at]uncw.edu  _______________________________________________________.

83

Basic MDA

PIM

ModelTransformation

CORBAPSM

J2EE .Net.Net

– Platform Independent Models (PIM)

– Mappings : PIM <==> PSM • QVT, MOF 2.0 (a

standard for describing transformations)

– Platform Specific Models (PSM)

Page 84: Model Driven Development (MDD) Devon M. Simmonds Computer Science Department UNCW simmondsd[at]uncw.edu  _______________________________________________________.

Computation Independent (Business) Model

Platform Independent Model

Platform Specific Model

T1

T5

T6

T7

T2

T4

MDA proposesmodel-to-model transformations

T1 – T7 are transformations

The MDA – Models & Transformations

T3

84

Page 85: Model Driven Development (MDD) Devon M. Simmonds Computer Science Department UNCW simmondsd[at]uncw.edu  _______________________________________________________.

Platform Independence?

Depends on the selection of the target platform! (see next slide)

85

Page 86: Model Driven Development (MDD) Devon M. Simmonds Computer Science Department UNCW simmondsd[at]uncw.edu  _______________________________________________________.

86

Aspect Oriented Model-driven Development Framework (AOMDF)

Model B map-pings

Develop source models

Develop Model Amappings

SpecifyTransformation

Apply Model Amappings

ApplyTransformation

Model A map-pings

SourceModel A

TargetModel A

TargetModel B

Source Level

Transformation Specification

Phase

Target Level

SourceModel B

Composition

Composition

transfo

rmatio

ns

transfo

rmatio

ns

Specification

Page 87: Model Driven Development (MDD) Devon M. Simmonds Computer Science Department UNCW simmondsd[at]uncw.edu  _______________________________________________________.

87

MDA & Code Generation

Page 88: Model Driven Development (MDD) Devon M. Simmonds Computer Science Department UNCW simmondsd[at]uncw.edu  _______________________________________________________.

MDA – More Benefits

Reduced cost throughout the application life-cycle.Reduced development time for new applications.Rapid inclusion of emerging technology benefits into existing systems.Reduced complexity of application development, maintenance and evolution.Domain SpecificityImplementation of new applications for different platforms.Productivity - 30% increase with a model-driven engineering approach.

The MDA boasts many success stories!

88

Page 89: Model Driven Development (MDD) Devon M. Simmonds Computer Science Department UNCW simmondsd[at]uncw.edu  _______________________________________________________.

See Some Proof of Concept!

89

Page 90: Model Driven Development (MDD) Devon M. Simmonds Computer Science Department UNCW simmondsd[at]uncw.edu  _______________________________________________________.

90

______________________Devon M. Simmonds

Computer Science Department

University of North Carolina Wilmington

_____________________________________________________________

Qu es ti ons?

End of This Module

Page 91: Model Driven Development (MDD) Devon M. Simmonds Computer Science Department UNCW simmondsd[at]uncw.edu  _______________________________________________________.

The Analysis Challenge

Can we determine properties of the program before the code is generated?

• An open research question!

• Challenges– Abstraction:

specifying models– Automation:

transforming models, compiling models (e.g., code generation)

– Analysis: determining properties of models

– Evolution/Reuse: Changing and using models for developing other applications

91

Page 92: Model Driven Development (MDD) Devon M. Simmonds Computer Science Department UNCW simmondsd[at]uncw.edu  _______________________________________________________.

92

______________________Devon M. Simmonds

Computer Science Department

University of North Carolina Wilmington

_____________________________________________________________

Qu es ti ons?

The End

Page 93: Model Driven Development (MDD) Devon M. Simmonds Computer Science Department UNCW simmondsd[at]uncw.edu  _______________________________________________________.

Other Slides

93

Page 94: Model Driven Development (MDD) Devon M. Simmonds Computer Science Department UNCW simmondsd[at]uncw.edu  _______________________________________________________.

Distributed System

A distributed system consists of a set of interconnected computers called a network. – Computer programs execute on each network

computer, and coordinate actions by exchanging messages over the network.

94

Page 95: Model Driven Development (MDD) Devon M. Simmonds Computer Science Department UNCW simmondsd[at]uncw.edu  _______________________________________________________.

Middleware

Middleware is system software that occurs between the application and the operating system. – Its primary purpose is to simplify the development of

distributed systems by providing a variety of features to the distributed applications.• Access to infrastructural details such as operating system,

hardware, and network specifics.• Access to local, remote, and mobile resources. • A menu of standard services. 95

Page 96: Model Driven Development (MDD) Devon M. Simmonds Computer Science Department UNCW simmondsd[at]uncw.edu  _______________________________________________________.

96

Behavioral Elements of UML Metamodel

Page 97: Model Driven Development (MDD) Devon M. Simmonds Computer Science Department UNCW simmondsd[at]uncw.edu  _______________________________________________________.

Interaction Diagram Metamodel(see handout)

97

1. Can you derive the relationship between a message end and a lifeline?

2. Can you derive the relationship between a messageand an operation?2. Can you derive the relationship between a classand a lifeline?

Page 98: Model Driven Development (MDD) Devon M. Simmonds Computer Science Department UNCW simmondsd[at]uncw.edu  _______________________________________________________.

The Analysis Challenge

Can we determine properties of the program before the code is generated?

• An open research question!

• Challenges– Abstraction:

specifying models– Automation:

transforming models, compiling models (e.g., code generation)

– Analysis: determining properties of models

– Evolution/Reuse: Changing and using models for developing other applications

98

Page 99: Model Driven Development (MDD) Devon M. Simmonds Computer Science Department UNCW simmondsd[at]uncw.edu  _______________________________________________________.

99

Metadata and the UML

Metamodel

Next