01 mde principles

75
Model Driven Engineering MDE Principles Ludovico Iovino ludovico.iovino@gssi. infn.it ludovico.iovino@univa

Transcript of 01 mde principles

Page 1: 01 mde principles

Model Driven EngineeringMDE Principles Ludovico Iovino

[email protected]@univaq.it

Page 2: 01 mde principles

Roadmap

What is a model ?

What is Model Driven Engineering ?

MDSE Application

Metamodeling, modeling and transformations

01

02

03

04

Page 3: 01 mde principles

The human mind continuously re-works reality by applying cognitive processes

Abstraction

Important notions of abstraction

What is a model ?

Capability of finding the commonality in many different observations

generalize specific features of real objects classify the objects into coherent clusters aggregate objects into more complex ones

We will see…

Abstraction and human mind

Page 4: 01 mde principles

Human mind

Re-works reality

Applying cognitive process

2 different realities

The Brainstorming

The Great Thinking

Page 5: 01 mde principles

Do you know what a model is about ?

Page 6: 01 mde principles

ExampleLet us consider a system in reality

Page 7: 01 mde principles

Modelfor our system

Let us consider a now a

Page 8: 01 mde principles

Modelfor our system

Let us consider a now a

Page 9: 01 mde principles

What about asking a child to draw a model for our

system ?

Page 10: 01 mde principles

What about asking a child to draw a model for our

system ?

Page 11: 01 mde principles

What about asking a child to draw a model for our

system ?

Page 12: 01 mde principles

What is a model ?

Page 13: 01 mde principles

A model reflects author’s background

Page 14: 01 mde principles

A model reflects author’s background

and whishes

Page 15: 01 mde principles
Page 16: 01 mde principles

Ludovico Iovino, Model Driven Engineering– MDE principles

What is a model?- A model represents reality for the given purpose; - The model is an abstraction of reality in the sense that it cannot

represent all aspects of reality

Page 17: 01 mde principles

Ludovico Iovino, Model Driven Engineering– MDE principles

What is a model?- A model represents reality for the given purpose; - The model is an abstraction of reality in the sense that it cannot

represent all aspects of reality- Modeling, in the broadest sense, is the cost-effective use of

something in place of something else for some cognitive purpose.

Page 18: 01 mde principles

Ludovico Iovino, Model Driven Engineering– MDE principles

What is a model?- A model represents reality for the given purpose; - The model is an abstraction of reality in the sense that it cannot

represent all aspects of reality- Modeling, in the broadest sense, is the cost-effective use of

something in place of something else for some cognitive purpose. - It allows us to use something that is simpler, safer or cheaper than

reality instead of reality for some purpose

Page 19: 01 mde principles

This allows us to deal with the world in a simplified

manner, avoiding the complexity, danger and

irreversibility of reality

Simpler, safer or cheaper than reality

Page 20: 01 mde principles

Ludovico Iovino, Model Driven Engineering– MDE principles

What is a model?- A model represents reality for the given purpose; - The model is an abstraction of reality in the sense that it cannot

represent all aspects of reality- Modeling, in the broadest sense, is the cost-effective use of

something in place of something else for some cognitive purpose. - It allows us to use something that is simpler, safer or cheaper than

reality (instead of reality) for some purpose- This allows us to deal with the world in a simplified manner, avoiding

the complexity, danger and irreversibility of reality

Page 21: 01 mde principles

Ludovico Iovino, Model Driven Engineering– MDE principles

What is a model?- A model represents reality for the given purpose; - The model is an abstraction of reality in the sense that it cannot

represent all aspects of reality- Modeling, in the broadest sense, is the cost-effective use of

something in place of something else for some cognitive purpose. - It allows us to use something that is simpler, safer or cheaper than

reality instead of reality for some purpose- This allows us to deal with the world in a simplified manner, avoiding

the complexity, danger and irreversibility of reality

Page 22: 01 mde principles

The world boundaries directly affect the assumptions on the model semantics

Page 23: 01 mde principles

1 2

Page 24: 01 mde principles

1 2

What does it mean?

Page 25: 01 mde principles

1 2

What does it mean? «2» comes after «1»«2» depends on «1» «1» specializes/refines «2»«2» listens to «1»«2» contains «1»etc

Page 26: 01 mde principles

1 2

- What does it mean?- How many different meanings are you able to attach to it?

Page 27: 01 mde principles
Page 28: 01 mde principles

Ludovico Iovino, Model Driven Engineering– MDE principles

So…what is a model?

Page 29: 01 mde principles

Ludovico Iovino, Model Driven Engineering– MDE principles

So…what is a model?- A simplified or partial representation of reality, defined in order to

accomplish a task or to reach an agreement

Page 30: 01 mde principles

Ludovico Iovino, Model Driven Engineering– MDE principles

So…what is a model?- A simplified or partial representation of reality, defined in order to

accomplish a task or to reach an agreement

ModelrepresentsSystem

Mapping Feature A model is based on an original (=system)

Page 31: 01 mde principles

Ludovico Iovino, Model Driven Engineering– MDE principles

So…what is a model?- A simplified or partial representation of reality, defined in order to

accomplish a task or to reach an agreement

ModelrepresentsSystem

Mapping Feature A model is based on an original (=system)Reduction Feature A model only reflects a (relevant) selection of the

original‘s properties

Page 32: 01 mde principles

Ludovico Iovino, Model Driven Engineering– MDE principles

So…what is a model?- A simplified or partial representation of reality, defined in order to

accomplish a task or to reach an agreement

ModelrepresentsSystem

Mapping Feature A model is based on an original (=system)Reduction Feature A model only reflects a (relevant) selection of the

original‘s properties

Pragmatic Feature A model needs to be usable in place of an original with respect to some purpose

Page 33: 01 mde principles

MotivationWhat is Model Driven Engineering ?

Page 34: 01 mde principles

MotivationWhat is Model Driven Engineering ?

Shifting focus from code centric techniques to Models

Page 35: 01 mde principles

MotivationWhat is Model Driven Engineering ?

Shitfting focus from code centric techniques to Models

Page 36: 01 mde principles

Ludovico Iovino, Model Driven Engineering– MDE principles

Motivation- Model as the central artifact of software development

Model

Rapid prototyping

Static analysis

Code generation

Automated testing

Refactoring/Transformation

Documentation

Page 37: 01 mde principles

Ludovico Iovino, Model Driven Engineering– MDE principles

Motivation- Quality problems in software development

[Slide by Bernhard Rumpe]

Page 38: 01 mde principles

Ludovico Iovino, Model Driven Engineering– MDE principles

Motivation- Quality problems in software development

[Slide by Bernhard Rumpe]

Page 39: 01 mde principles

Ludovico Iovino, Model Driven Engineering– MDE principles

Motivation- Quality problems in software development

[Slide by Bernhard Rumpe]

Page 40: 01 mde principles

Ludovico Iovino, Model Driven Engineering– MDE principles

Motivation- Quality problems in software development

[Slide by Bernhard Rumpe]

Page 41: 01 mde principles

Ludovico Iovino, Model Driven Engineering– MDE principles

Motivation- Traditional usage of models in software development

- Communication with customers and users (requirement specification, prototypes)

- Support for software design, capturing of the intention- Task specification for programming - Code visualization

[Slide by Bernhard Rumpe]

Page 42: 01 mde principles

Ludovico Iovino, Model Driven Engineering– MDE principles

MotivationModels as drafts- Communication of ideas and alternatives- Objective: modeling per se

Models as guidelines- Design decisions are documented- Objective: instructions for implementation

Models as programs- Applications are generated automatically- Objective: models are source code and vice versa

[Slide by Bernhard Rumpe]

t

Page 43: 01 mde principles

Ludovico Iovino, Model Driven Engineering– MDE principles

MDSE Concepts- Model Driven Software Engineering (MDSE) concepts

Page 44: 01 mde principles

Ludovico Iovino, Model Driven Engineering– MDE principles

Model Driven Software Engineering (MDSE) conceptsAbstraction from specific realization technologies- Requires modeling languages, which do not hold specific concepts of realization technologies (e.g., Java

EJB)- Improved portability of software to new/changing technologies – model once, build everywhere- Interoperability between different technologies can be automated (so called Technology Bridges)

Automated code generation from abstract models- e.g., generation of Java-APIs, XML Schemas, etc. from UML- Requires expressive and precise models- Increased productivity and efficiency (models stay up-to-date)

Separate development of application and infrastructure- Separation of application-code and infrastructure-code (e.g. Application Framework) increases

reusability- Flexible development cycles as well as different development roles possible

Page 45: 01 mde principles

Ludovico Iovino, Model Driven Engineering– MDE principles

Model Driven Software Engineering (MDSE) Equation

Models

Page 46: 01 mde principles

Ludovico Iovino, Model Driven Engineering– MDE principles

Model Driven Software Engineering (MDSE) Equation

+Models Transformations

Page 47: 01 mde principles

Ludovico Iovino, Model Driven Engineering– MDE principles

Model Driven Software Engineering (MDSE) Equation

+Models Transformations Software=

Page 48: 01 mde principles

Ludovico Iovino, Model Driven Engineering– MDE principles

Model Driven Software Engineering (MDSE) Equation

+Models Transformations Software=

Minimal MD Infrastructure

Page 49: 01 mde principles

Ludovico Iovino, Model Driven Engineering– MDE principles

The MD* Jungle of Acronyms- Model-Driven Development (MDD) is a development paradigm that uses

models as the primary artifact of the development process. - Model-driven Architecture (MDA) is the particular vision of MDD proposed by

the Object Management Group (OMG) - Model-Driven Engineering (MDE) is a superset of MDD because it goes beyond

of the pure development - Model-Based Engineering (or “model-based development”) (MBE) is a softer

version of MDE, where models do not “drive” the process

Page 50: 01 mde principles

Ludovico Iovino, Model Driven Engineering– MDE principles

Target of MDSE- The Problem Domain is defined as the field or area of expertise that

needs to be examined to solve a problem.- The Domain Model is the conceptual model of the problem domain

(entities, relations, roles, constraint)- Technical Spaces represent specific working contexts for the

specification, implementation, and deployment of applications (decide the storage formats)

Page 51: 01 mde principles

Ludovico Iovino, Model Driven Engineering– MDE principles

Target of MDSE- The Problem Domain is defined as the field or area of expertise that

needs to be examined to solve a problem.- The Domain Model is the conceptual model of the problem domain

(entities, relations, roles, constraint)- Technical Spaces represent specific working contexts for the

specification, implementation, and deployment of applications (decide the storage formats)

Page 52: 01 mde principles

Ludovico Iovino, Model Driven Engineering– MDE principles

Target of MDSE- The Problem Domain is defined as the field or area of expertise that

needs to be examined to solve a problem.- The Domain Model is the conceptual model of the problem domain

(entities, relations, roles, constraint)- Technical Spaces represent specific working contexts for the

specification, implementation, and deployment of applications (decide the storage formats)

Page 53: 01 mde principles

Ludovico Iovino, Model Driven Engineering– MDE principles

Modeling languages- Domain-Specific Languages (DSLs): languages that are designed

specifically for a certain domain or context- DSLs have been largely used in computer science. Examples: HTML,

Logo, VHDL, SQL

- General Purpose Modeling Languages (GPMLs, GMLs, or GPLs): languages that can be applied to any sector or domain for (software) modeling purposes

- The typical examples are: UML, Petri-nets, or state machines

Page 54: 01 mde principles

Ludovico Iovino, Model Driven Engineering– MDE principles

Metamodeling- To represent the models themselves as “instances” of some more

abstract models.- Metamodel = yet another abstraction, highlighting properties of the

model itself - Modelware is the MDSE paradigm not so different from

grammarware

Page 55: 01 mde principles

Ludovico Iovino, Model Driven Engineering– MDE principles

Metamodeling- To represent the models themselves as “instances” of some more

abstract models.- Metamodel = yet another abstraction, highlighting properties of the

model itself - The relationship between models and metamodel is called

conformance (c2)

m

MM

Conform to (c2)

Page 56: 01 mde principles

Ludovico Iovino, Model Driven Engineering– MDE principles

Metamodeling

Page 57: 01 mde principles

What is a model Transformation?

Page 58: 01 mde principles

Ludovico Iovino, Model Driven Engineering– MDE principles

Model Transformation- Transformations are defined at metamodel level but applied at model level- MDSE provides appropriate languages for defining model transformation

rules- Rules can be written manually from scratch by a developer, or can be

defined as a refined specification of an existing one. - Alternatively, transformations themselves can be produced automatically

out of some higher level mapping rules between models- defining a mapping between elements of a model to elements to another one

(model mapping or model weaving)- automating the generation of the actual transformation rules through a system that

receives as input the two model definitions and the mapping

- Transformations themselves can be seen as models!

Page 59: 01 mde principles

Ludovico Iovino, Model Driven Engineering– MDE principles

Model Transformation

Page 60: 01 mde principles

Ludovico Iovino, Model Driven Engineering– MDE principles

Model Transformation- Software modernization

Page 61: 01 mde principles

Ludovico Iovino, Model Driven Engineering– MDE principles

Model Transformation- Software modernization

Exomorphic Transformation

Page 62: 01 mde principles

Ludovico Iovino, Model Driven Engineering– MDE principles

Model Transformation- Software modernization

Exomorphic TransformationTransforms this view into another view

Page 63: 01 mde principles

Ludovico Iovino, Model Driven Engineering– MDE principles

Model Classification- A very simple way of classifying the modeling languages and the

respective models is based on the level of abstraction at which the modeling is performed- Describe requirements and needs at very abstract level without details to the

implementation- Define the behavior of the system in terms of stored data w/o technological

details- Define all the technological aspects in detail

Page 64: 01 mde principles

Ludovico Iovino, Model Driven Engineering– MDE principles

Model Classification- Static models: Focus on the static aspects of the system in terms of

managed data and of structural shape and architecture of the system.

- Dynamic models: Emphasize the dynamic behavior of the system by showing the execution

Page 65: 01 mde principles

Ludovico Iovino, Model Driven Engineering– MDE principles

Model Classification- Static models: Focus on the static aspects of the system in terms of

managed data and of structural shape and architecture of the system.

- Dynamic models: Emphasize the dynamic behavior of the system by showing the execution

Page 66: 01 mde principles

Ludovico Iovino, Model Driven Engineering– MDE principles

Model Classification- Static models: Focus on the static aspects of the system in terms of

managed data and of structural shape and architecture of the system.

- Dynamic models: Emphasize the dynamic behavior of the system by showing the execution

Page 67: 01 mde principles

Ludovico Iovino, Model Driven Engineering– MDE principles

MDSE adoption in Industry- Some studies done in the past 5 years show that modeling is not

extensively adopted among practitioners - New developments in the last few years in terms of new technologies

and the release of standard tools have changed the landscape- As Steve Mellor like to say “modeling and MDE will be commonplace

in 3 years time”

Page 68: 01 mde principles

Ludovico Iovino, Model Driven Engineering– MDE principles

MDSE adoption in Industry- Some studies done in the past 5 years show that modeling is not

extensively adopted among practitioners - New developments in the last few years in terms of new technologies

and the release of standard tools have changed the landscape- As Steve Mellor like to say “modeling and MDE will be commonplace

in 3 years time [since 1985]

Page 69: 01 mde principles

Ludovico Iovino, Model Driven Engineering– MDE principles

MDSE adoption in Industry- Experts think that the biggest challenges faced by companies

adopting MDE approaches are not much on the technical side…

Page 70: 01 mde principles

Ludovico Iovino, Model Driven Engineering– MDE principles

MDSE adoption in Industry- Experts think that the biggest challenges faced by companies

adopting MDE approaches are not much on the technical side…- But much more on the human factor side:

“Dealing with people’s habits and resistance to change”“Accepting and adopting standards”“Tool availability, business lines ,…”“Impatience of getting to the results”

Page 71: 01 mde principles

Ludovico Iovino, Model Driven Engineering– MDE principles

Tool support- Many people assume that drawing tools and modeling tools are two

interchangeable concepts

Page 72: 01 mde principles

Ludovico Iovino, Model Driven Engineering– MDE principles

Tool support- Many people assume that drawing tools and modeling tools are two

interchangeable concepts … this is far from true- Only some tools are drawing and modeling tools at the same time- Some modeling tools use a concrete textual syntax for specifying

models and thus there is no support for drawing in them

Page 73: 01 mde principles

Many drawing tools are not modeling tools. A drawing tool can be considered a modeling tool if the tool “understands” the drawings

Tool support

Page 74: 01 mde principles

Many drawing tools are not modeling tools. A drawing tool can be considered a modeling tool if the tool “understands” the drawings

Tool support

Check the correctnessHave a meaningCan be exportedCan be processed

Page 75: 01 mde principles