Model Driven Development An introduction. Overview Using Models Using Models in Software Feasibility...

38
Model Driven Development An introduction

Transcript of Model Driven Development An introduction. Overview Using Models Using Models in Software Feasibility...

Model Driven DevelopmentModel Driven DevelopmentAn introductionAn introduction

OverviewOverview

• Using Models •• Using Models in Software •

• Feasibility of MDA •• MDA Technologies •

• The Unified Modeling Language •• What we are doing & Conclusion •

• Using Models •• Using Models in Software •

• Feasibility of MDA •• MDA Technologies •

• The Unified Modeling Language •• What we are doing & Conclusion •

Using ModelsUsing Models

Using ModelsUsing Models• Examples• Examples

PrecisemodelsPrecisemodels

SimulationVerificationSimulationVerification ConstructieConstructie

Using ModelsUsing Models• Examples• Examples

Different views… for each stakeholder …

… all interconnected …

Different views… for each stakeholder …

… all interconnected …

ElectricianElectrician Interior designerInterior designer

MarketingMarketing

ArchitectArchitect

Using ModelsUsing Models• Examples• Examples

Zoom levels… information hiding …… understandability …

Zoom levels… information hiding …… understandability …

A bluilding in its environmentA bluilding in its environmentA room in the buildingA room in the building

Structural viewStructural view

Using ModelsUsing Models• Good models

– Offer different views– Abstract away details [zooming]– Are understandable [symbols]– Are precise [and complete]– Follow common standards

• Good models– Offer different views– Abstract away details [zooming]– Are understandable [symbols]– Are precise [and complete]– Follow common standards

Using ModelsUsing Models• Why model?

– Manage and understand great complexity– Experiment (simulate)– Communicate– Construction manual– User manual / documentation

• Why model?– Manage and understand great complexity– Experiment (simulate)– Communicate– Construction manual– User manual / documentation

Using Models In SoftwareUsing Models In Software

Using Models In SoftwareUsing Models In Software•Many software projects•Many software projects

ConstructionConstruction

if (expression) { statements; } else { statements; } for (expression; expression; expression) { statements; } do { statements; } while (expression); while (expression) { statements; } switch (expression) { case constant: statements; break; default: statements; if (expression) { statements; } else { statements; } for (expression; expression; expression) { statements; } do { statements; } while (expression); while (expression) { statements; } switch (expression) { case constant: statements; break; default: statements;

if (expression) { statements; } else { statements; } for (expression; expression; expression) { statements; } do { statements; } while (expression); while (expression) { statements; } switch (expression) { case constant: statements; break; default: statements; if (expression) { statements; } else { statements; } for (expression; expression; expression) { statements; } do { statements; } while (expression); while (expression) { statements; } switch (expression) { case constant: statements; break; default: statements;

if (expression) { statements; } else { statements; } for (expression; expression; expression) { statements; } do { statements; } while (expression); while (expression) { statements; } switch (expression) { case constant: statements; break; default: statements; if (expression) { statements; } else { statements; } for (expression; expression; expression) { statements; } do { statements; } while (expression); while (expression) { statements; } switch (expression) { case constant: statements; break; default: statements;

Where are the Models?[code is a model too!]

Where are the Models?[code is a model too!]

PrecisemodelsPrecisemodels

SimulationVerificationSimulationVerification

But.. • One view• One level of detail• Not understandable• Not very abstract

But.. • One view• One level of detail• Not understandable• Not very abstract

Using Models In SoftwareUsing Models In Software•More positive•More positive

PrecisemodelsPrecisemodels Simulation

VerificationSimulationVerification

ConstructionConstruction

if (expression) { statements; } else { statements; } for (expression; expression; expression) { statements; } do { statements; } while (expression); while (expression) { statements; } switch (expression) { case constant: statements; break; default: statements; if (expression) { statements; } else { statements; } for (expression; expression; expression) { statements; } do { statements; } while (expression); while (expression) { statements; } switch (expression) { case constant: statements; break; default: statements;

if (expression) { statements; } else { statements; } for (expression; expression; expression) { statements; } do { statements; } while (expression); while (expression) { statements; } switch (expression) { case constant: statements; break; default: statements; if (expression) { statements; } else { statements; } for (expression; expression; expression) { statements; } do { statements; } while (expression); while (expression) { statements; } switch (expression) { case constant: statements; break; default: statements;

if (expression) { statements; } else { statements; } for (expression; expression; expression) { statements; } do { statements; } while (expression); while (expression) { statements; } switch (expression) { case constant: statements; break; default: statements; if (expression) { statements; } else { statements; } for (expression; expression; expression) { statements; } do { statements; } while (expression); while (expression) { statements; } switch (expression) { case constant: statements; break; default: statements;

??

(Long term) value?(Long term) value?

Using Models In SoftwareUsing Models In Software• Model Driven Development

– Precise models [same goals as other industries] Raising the abstraction level further Separating application logic from

the implementing technology Automatic model transformations

• Model Driven Architecture– MDD, the OMG way– Others are MS Software factories, Model

IntegratedComputing, etc.

• Common principles• We will talk mainly about MDA

• Model Driven Development– Precise models [same goals as other industries] Raising the abstraction level further Separating application logic from

the implementing technology Automatic model transformations

• Model Driven Architecture– MDD, the OMG way– Others are MS Software factories, Model

IntegratedComputing, etc.

• Common principles• We will talk mainly about MDA

The MDA page - www.omg.org/mdaThe MDA vision - www.omg.org/docs/ormsc/01-07-01.pdf

*

Using Models In SoftwareUsing Models In Software• Model once, Generate anywhere

– Platform Independent Model– Platform Description Model– Platform Specific Model

• Model once, Generate anywhere– Platform Independent Model– Platform Description Model– Platform Specific Model

PIM PDM

PSM Code

Transformer

Essentialsystem concepts

Essentialsystem concepts

- Changing platform [C++|CORBA, J2EE, .NET]

- Design decisions

- Changing platform [C++|CORBA, J2EE, .NET]

- Design decisions

(Mark)(Mark) *

Using Models In SoftwareUsing Models In Software• Is this feasible?

– Looking for a possible answer in SW history

• Is this feasible?– Looking for a possible answer in SW history

Feasibility of MDAFeasibility of MDA

Feasibility of MDAFeasibility of MDA• Evolution• Evolution

Hardware

Operating System

Middleware

0’en en 1’en

Assembly

3GL

Programmingenvironment

Programmingenvironment

PlatformPlatform

Level of

ab

str

cti

on

Level of

ab

str

cti

on

Level of

ab

str

cti

on

Level of

ab

str

cti

on

“Transform to”(“Compile to”)

“Transform to”(“Compile to”)

“Use”“Use”

The increase of the level of abstraction at both sides is the enabler of MDA

The increase of the level of abstraction at both sides is the enabler of MDA

Feasibility of MDAFeasibility of MDA• Semantic gap closes• Semantic gap closes

MDA

Machine code

Machine code with OS

3GL with OS

3GL with MW

Model A

Model B

Model C

Level of

ab

str

cti

on

Level of

ab

str

cti

on

Level of

ab

str

cti

on

Level of

ab

str

cti

on

Mod

el

Tra

nsfo

rmati

on

sM

od

el

Tra

nsfo

rmati

on

s

The Abstract Platform - http://wwwhome.cs.utwente.nl/~alme/cvitae/almeida-edoc2004-abstractplatform.pdf

Modeler’splaygroundModeler’s

playground

Programmer’splaygroundProgrammer’splayground

MDA TechnologiesMDA Technologies

MDA TechnologiesMDA Technologies• MDA is all about standards

– Modeling• UML2• CWM• …

– Meta modeling• MOF

– Model Exchange• XMI• UML Diagram interchange

– Transformations• QVT• Templates• General scripts• …

• MDA is all about standards– Modeling

• UML2• CWM• …

– Meta modeling• MOF

– Model Exchange• XMI• UML Diagram interchange

– Transformations• QVT• Templates• General scripts• …

11

22

33

44

Define your own languageDefine your own language

Model the applicationModel the application

Use different tools to …Use different tools to …

… execute the necessary transformations… execute the necessary transformations

MDA TechnologiesMDA Technologies• (Meta) modeling

– A model has no meaning when separated from its meta model

• (Meta) modeling– A model has no meaning when

separated from its meta modelView AView A

View BView B

ZoomZoom

MDA TechnologiesMDA Technologies• 4 meta levels• 4 meta levels

MOF - Meta Object Facility

UML, CWM, RDBM, your language

Classes, associations, operations, etc.Tables, keys, etc.

Objects, links, etc.Records etc.

M3M3

M2M2

M1M1

M0M0

“Talk

ab

ou

t”“D

efi

ne”

“Talk

ab

ou

t”“D

efi

ne”

“In

sta

nce o

f”“In

sta

nce o

f”

MDA TechnologiesMDA Technologies• Applied to UML• Applied to UML

M3M3

M2M2

M1M1

M0M0

“Talk

ab

ou

t”“D

efi

ne”

“Talk

ab

ou

t”“D

efi

ne”

“In

sta

nce o

f”“In

sta

nce o

f”

Class Associationsource

destination

Class Attribute1 *

Person

Name: String

man:Person

Name = Jan

MDA TechnologiesMDA Technologies• Transformations• Transformations

MOF

UML

UMLmodel

M3M3

M2M2

M1M1

RDBM

RDBMmodel

Definetransformation

Applytransformation

MOF::Class(name=class) MOF::Class(name=table)

UML::Class(name=person) RDBM::Table(name=person)

MDA TechnologiesMDA Technologies• Transformations

– Defined at the meta level– Executed at the model level– Source & target model– Replace / Add / Remove elements– Inter / Intra language

• Transformation stages– From more abstract to more platform specific– E.g.

• Transformations– Defined at the meta level– Executed at the model level– Source & target model– Replace / Add / Remove elements– Inter / Intra language

• Transformation stages– From more abstract to more platform specific– E.g.

UML AUML B

(persistency)UML B

(Logging)UML B

(Language)TF 1 TF2 TF3

MDA TechnologiesMDA Technologies• Transformations based on

– Target language limitations• E.g. UML-UML[Java]: remove multiple inheritance

– Aspects• Weave aspect models in the primary model

– Model annotations• Using profiles

• Transformations based on– Target language limitations

• E.g. UML-UML[Java]: remove multiple inheritance

– Aspects• Weave aspect models in the primary model

– Model annotations• Using profiles

Equivalence Rules for UML Class Diagrams, M. Gogolla, M. RichtersAn Aspect-Based Approach to Modeling Access Control Concerns, I. Ray, R. France, G. GeorgAn Introduction to UML Profiles, L. Fuentes-Fernández, A. Vallecillo-Moreno

MDA TechnologiesMDA Technologies• Defining transformations

– “The missing link”– Many specific - non standard - ways– Wait for QVT - Query, View, Transform

IBM Model Transformation Framework (MTF)

• Defining transformations– “The missing link”– Many specific - non standard - ways– Wait for QVT - Query, View, Transform

IBM Model Transformation Framework (MTF)

MTF - www-128.ibm.com/developerworks/rational/library/05/503_sebas/Query View Transform RFP - www.omg.org/cgi-bin/doc?ad/2002-4-10

MDA TechnologiesMDA Technologies• Interoperability

– Based on MOF– Model exchange - XMI– Reflective APIs - JMI, C(ORBA)MI, etc.

• Interoperability– Based on MOF– Model exchange - XMI– Reflective APIs - JMI, C(ORBA)MI, etc.

Tool busTool bus

DesingerTool

TransformationTool

SimulationTool

...

The Unified Modeling LanguageThe Unified Modeling LanguageV2.0V2.0

The Unified Modeling LanguageThe Unified Modeling Language• What is it?

– A visual modeling language– To specify software in a OO fashion– Now: UML 2.0 to better support MDA

• What will we discuss?– Action Semantics– Profiles

• What is it?– A visual modeling language– To specify software in a OO fashion– Now: UML 2.0 to better support MDA

• What will we discuss?– Action Semantics– Profiles

The Unified Modeling LanguageThe Unified Modeling Language• Most used in UML

– Use case diagram– Class diagram– Communication/Sequence diagram

• Most used in UML– Use case diagram– Class diagram– Communication/Sequence diagram

The Unified Modeling LanguageThe Unified Modeling Language• We need to start using

– State charts [state of an object]– Activity diagrams [state of an algorithm]

• We need to start using– State charts [state of an object]– Activity diagrams [state of an algorithm]

The Unified Modeling LanguageThe Unified Modeling Language

The Unified Modeling LanguageThe Unified Modeling Language• Action Semantics

– Really act upon your models• Create objects, set attributes, etc.

– In a platform independent way– Using Activity diagrams– And/Or an Action Specification Language (ASL)– Mostly used in the xUML area

• Action Semantics– Really act upon your models

• Create objects, set attributes, etc.

– In a platform independent way– Using Activity diagrams– And/Or an Action Specification Language (ASL)– Mostly used in the xUML area

Book (2004) : Model Driven Architecture with Excutable UMLUML 2.0 Activity and Action Models - http://www.jot.fm/issues/issue_2003_07/column3

The Unified Modeling LanguageThe Unified Modeling Language• Profiles

– Customization of UML (or any other MOF model)

– The main uses of profiles are• Adding custom symbols to constructs• Adding semantics (for semantics variation points)• Adding constraints• Generally adding information (for transformations

or documentation)

• Profiles– Customization of UML (or any other MOF

model)– The main uses of profiles are

• Adding custom symbols to constructs• Adding semantics (for semantics variation points)• Adding constraints• Generally adding information (for transformations

or documentation)

The Unified Modeling LanguageThe Unified Modeling Language• Profiles

– Annotations to standard UML models• Stereotypes, Tagged values and Constraints

• Profiles– Annotations to standard UML models

• Stereotypes, Tagged values and Constraints

DefinitionDefinition

ApplicationApplication

What we are doing& Conclusions

What we are doing& Conclusions

What we are doingWhat we are doing• What are we doing?

– Building experienced with UML 2.0 and all of its aspects in industrial cases

– Looking how to specify traceability between transformations and how to explicitly specify dependencies between transformations using profiles

– Setting up a UML based framework to configure component platforms in a platform independent way (currently for Draco and CCM)

– Modeling real time aspects in UML using profiles (future work)

• What are we doing?– Building experienced with UML 2.0 and all of its

aspects in industrial cases

– Looking how to specify traceability between transformations and how to explicitly specify dependencies between transformations using profiles

– Setting up a UML based framework to configure component platforms in a platform independent way (currently for Draco and CCM)

– Modeling real time aspects in UML using profiles (future work)

ConclusionsConclusions• MDA is

– Rising the level of abstraction• Specific (modeling) languages• Seperating business knowledge from

implementation technology

– Applying automatic transformations– Managing the metadata centrally

• Is MDA ready?– Still work in progress– But... We can use some parts

• UML+profiles• Limited code generation

• MDA is– Rising the level of abstraction

• Specific (modeling) languages• Seperating business knowledge from

implementation technology

– Applying automatic transformations– Managing the metadata centrally

• Is MDA ready?– Still work in progress– But... We can use some parts

• UML+profiles• Limited code generation