Top Banner
Modelo, luego existo - René Descartes
60

Modelo, luego existo - René Descartes · Nuestramisión Interested in the broad area of systems and software engineering, especially promoting the rigorous use of software models

Dec 02, 2018

Download

Documents

hoangbao
Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: Modelo, luego existo - René Descartes · Nuestramisión Interested in the broad area of systems and software engineering, especially promoting the rigorous use of software models

Modelo, luegoexisto

- René Descartes

Page 2: Modelo, luego existo - René Descartes · Nuestramisión Interested in the broad area of systems and software engineering, especially promoting the rigorous use of software models

Ingeniería del Software dirigida por modelos

Versión para incrédulos

Jordi Cabot – ICREA Research Professor at UOC

@softmodeling modeling-languages.com

Page 3: Modelo, luego existo - René Descartes · Nuestramisión Interested in the broad area of systems and software engineering, especially promoting the rigorous use of software models

SOM Research LabSoftware runs the world. Models run the software

Page 4: Modelo, luego existo - René Descartes · Nuestramisión Interested in the broad area of systems and software engineering, especially promoting the rigorous use of software models

El equipo

Postdoc

PhD Students

Professors

Lecturers

Page 5: Modelo, luego existo - René Descartes · Nuestramisión Interested in the broad area of systems and software engineering, especially promoting the rigorous use of software models

Nuestra misiónInterested in the broad

area of systems and software engineering, especially promoting the rigorous use of software

models and engineering principles in all software

engineering tasks.Flickr/clement127

Page 6: Modelo, luego existo - René Descartes · Nuestramisión Interested in the broad area of systems and software engineering, especially promoting the rigorous use of software models

ModelRapid prototyping

Static analysis

Code generation

Automated testing

Refactoring/Transformation

Documentation

[Illustration by Bernhard Rumpe]

IDM = Modelos como parte central de la Ingeniería del Software

Page 7: Modelo, luego existo - René Descartes · Nuestramisión Interested in the broad area of systems and software engineering, especially promoting the rigorous use of software models

Size doesn’t matter

Modelas y punto!!!

Page 8: Modelo, luego existo - René Descartes · Nuestramisión Interested in the broad area of systems and software engineering, especially promoting the rigorous use of software models

Model-driven

Engineering

El porqué: Casos de uso

El cómo:Claves parala adopción

El qué:Conceptos

básicos

Page 9: Modelo, luego existo - René Descartes · Nuestramisión Interested in the broad area of systems and software engineering, especially promoting the rigorous use of software models
Page 10: Modelo, luego existo - René Descartes · Nuestramisión Interested in the broad area of systems and software engineering, especially promoting the rigorous use of software models

• Asterix view : resistentes al modelado

Page 11: Modelo, luego existo - René Descartes · Nuestramisión Interested in the broad area of systems and software engineering, especially promoting the rigorous use of software models

• Grady Booch – history of softwre engineering

The entire history of software engineering is that of the rise in levels of abstraction

- Grady Booch

OBJETIVO: Escribir cada vez menos código

Page 12: Modelo, luego existo - René Descartes · Nuestramisión Interested in the broad area of systems and software engineering, especially promoting the rigorous use of software models
Page 13: Modelo, luego existo - René Descartes · Nuestramisión Interested in the broad area of systems and software engineering, especially promoting the rigorous use of software models

MDE es la formalización (culminación?) de este proceso

Page 14: Modelo, luego existo - René Descartes · Nuestramisión Interested in the broad area of systems and software engineering, especially promoting the rigorous use of software models

(common-sense) code generation

Page 15: Modelo, luego existo - René Descartes · Nuestramisión Interested in the broad area of systems and software engineering, especially promoting the rigorous use of software models

Beneficios MDE (bien hecho)

+productividad +calidad +Mantenimiento ….

2X – 8X 1.2X – 4X 80%

Page 16: Modelo, luego existo - René Descartes · Nuestramisión Interested in the broad area of systems and software engineering, especially promoting the rigorous use of software models

MDE es >> que generación de código

MDE(softwareengineering)

MDD(software development)

Page 17: Modelo, luego existo - René Descartes · Nuestramisión Interested in the broad area of systems and software engineering, especially promoting the rigorous use of software models

MDE es modernización de Software

Page 18: Modelo, luego existo - René Descartes · Nuestramisión Interested in the broad area of systems and software engineering, especially promoting the rigorous use of software models

MDE es Open Data

Page 19: Modelo, luego existo - René Descartes · Nuestramisión Interested in the broad area of systems and software engineering, especially promoting the rigorous use of software models

• Everything is a model by Jean

Page 20: Modelo, luego existo - René Descartes · Nuestramisión Interested in the broad area of systems and software engineering, especially promoting the rigorous use of software models

To model, or not to model, this is the WRONG question

- Shakespeare

La buena pregunta: qué modelos, cuantos, con qué detalle....

Page 21: Modelo, luego existo - René Descartes · Nuestramisión Interested in the broad area of systems and software engineering, especially promoting the rigorous use of software models

• Eric Elliot on illiterate

Page 22: Modelo, luego existo - René Descartes · Nuestramisión Interested in the broad area of systems and software engineering, especially promoting the rigorous use of software models

Model-driven

Engineering

El porqué: Casos de uso

El cómo:Claves parala adopción

El qué:Conceptos

básicos

Page 23: Modelo, luego existo - René Descartes · Nuestramisión Interested in the broad area of systems and software engineering, especially promoting the rigorous use of software models
Page 24: Modelo, luego existo - René Descartes · Nuestramisión Interested in the broad area of systems and software engineering, especially promoting the rigorous use of software models

La equación MDE: Models +

Transformations = Software

Page 25: Modelo, luego existo - René Descartes · Nuestramisión Interested in the broad area of systems and software engineering, especially promoting the rigorous use of software models

Original model

1st

refinementnth

refinement

Model-to-model Transformation

Model-to-text Transformation

...

RequirementsUse Case

Class Diagram

Java Project

Page 26: Modelo, luego existo - René Descartes · Nuestramisión Interested in the broad area of systems and software engineering, especially promoting the rigorous use of software models

Qué es un modelo?

Mapping Feature Un model se basa en el original (=system)Reduction Feature Un modelo refleja sólo las propiedades relevantes del original

Pragmatic Feature Un modelo tiene que poder usarse en el original en un escenario concreto

ModelrepresentsSystem

Page 27: Modelo, luego existo - René Descartes · Nuestramisión Interested in the broad area of systems and software engineering, especially promoting the rigorous use of software models

Un modelo

27

Ciudad de Nantes = “system” a modelar

Un mapa es de hecho un modelodel sistema

La leyenda del mapa es la gramática / metamodelo

Existen diferentes tipos mapas: transporte, alcantarillado,… que dan “vistas” diferentes de la ciudad

Page 28: Modelo, luego existo - René Descartes · Nuestramisión Interested in the broad area of systems and software engineering, especially promoting the rigorous use of software models

Models & Metamodelos

28

representation of

System S

conforms to

Model M

MetamodelMM

Page 29: Modelo, luego existo - René Descartes · Nuestramisión Interested in the broad area of systems and software engineering, especially promoting the rigorous use of software models

Muy parecido al mundo de la programación

MDE Grammarware

MOF (metametamodel)

UML (metamodel)

ABank.uml

EBNF.g

Java.g

MyProgram.java

Page 30: Modelo, luego existo - René Descartes · Nuestramisión Interested in the broad area of systems and software engineering, especially promoting the rigorous use of software models

Qué lenguaje usar

O construye tu propio Domain-

Specific Language

Page 31: Modelo, luego existo - René Descartes · Nuestramisión Interested in the broad area of systems and software engineering, especially promoting the rigorous use of software models

Transformación de modelosModel-to-Model Transformation Pattern

MMa MMb

Ma Mba2b.mt

MMTLsource metamodel

source model target model

target metamodel

conformsTo

Execution Engine

conformsTo conformsTo

Page 32: Modelo, luego existo - René Descartes · Nuestramisión Interested in the broad area of systems and software engineering, especially promoting the rigorous use of software models

M2M Transformation example

Java M

conformsTo

A 2 VRule

C 2 CRule

UML2Java.atl

executionUML M

conformsTo

c1:Class

a1:Attribute

Trace Modelc1 -> c01 : C2Ca1 -> v01 : A2V

MMaClass

Attribute*attributes

Java MMClass

Variable* variables

v01:Variable

c01:Class

UML MM

Page 33: Modelo, luego existo - René Descartes · Nuestramisión Interested in the broad area of systems and software engineering, especially promoting the rigorous use of software models

Example #1 – Publication 2 Book

Journalname: String

Bookname: Stringid: Integer

Source Metamodel Target Metamodel

j2:Journalname = ACM Comp. Sur.

j3:Journalname = IEEE Software.

j1:Journalname = IEEE Computer

b2:Bookname = ACM Comp. Sur.id = 2

b3:Bookname = IEEE Software.id = 3

b1:Bookname = IEEE Computerid = 1

JournalCollection

BookCollection

jc1:JournalCollection

bc1:BookCollection

Source Model Target Model

journals books1..* 1..*

Page 34: Modelo, luego existo - René Descartes · Nuestramisión Interested in the broad area of systems and software engineering, especially promoting the rigorous use of software models

module Publication2Book; create OUT : Book from IN : Publication;

rule Collection2Collection {fromjc : Publication!JournalCollection

tobc : Book!BookCollection(

books <- jc.journals)

}

rule Journal2Book { fromj : Publication!Journal

tob : Book!Book (

name <- j.name)

}

Source Pattern

Target Pattern

Matched Rule

Header

Binding

Page 35: Modelo, luego existo - René Descartes · Nuestramisión Interested in the broad area of systems and software engineering, especially promoting the rigorous use of software models

Transformación modelo a textoMiniUML Metamodel

MiniUML Modelclass Student extends Person{

private String regNo;

public void setRegNo(…){…}

public String getRegNo(){…}

}

MiniJava Code

MiniJava Grammar

Model2Text

NamedElement

type : Type

type 0..1

Relationship

0..1 superClassminCard : IntegermaxCard : Integer

* *

– String– Boolean– …

«enumeration»Type

ClassDec := Modifier “class” Identifier [“extends”Identifier] ClassBody;

AttributeDec := Modifier Type Identifier“;”;

MethodDec := Modifier ReturnType Identifier “(”ParamList “)” “{” MethodBody “}”;

Identifier := {“a”-”z” | “A”-”Z” | “0”-”9”};

ClassAttribute

name: String

Person

StudentregNo : String

Page 36: Modelo, luego existo - René Descartes · Nuestramisión Interested in the broad area of systems and software engineering, especially promoting the rigorous use of software models

M2T : Motor de templates

«context class»public class «name» { String id, … }

Template Engine

Query

Result

Input

public class Person { String id, …}

Template

Text fragment

Meta-marker

Output1 Output2

…public class Customer { String id, …}

Person

Customer

Source Model

Produced Text

Page 37: Modelo, luego existo - René Descartes · Nuestramisión Interested in the broad area of systems and software engineering, especially promoting the rigorous use of software models

Acceleo[template public javaClass(aClass : Class)]

[file (aClass.name.toUpperFirst()+'.java', false, 'UTF-8')]package entities;

import java.io.Serializable;

public class [aClass.name/] implements Serializable {

[for (att : Attribute | aClass.atts) separator ('\n')][javaAttribute(att)/][/for]

[for (op : Operation | aClass.ops) separator ('\n')][javaMethod(op)/][/for]

}[/file][/template]

[template public javaMethod(op : Operation)]public [op.type/] [op.name/]() {

// [protected (op.name)]// Fill operation implementation

[returnStatement(op.type)/]// [/protected]

}[/template]

Open output file

Close output file

Static Text

ProtectedArea

Query

Template Call

Page 38: Modelo, luego existo - René Descartes · Nuestramisión Interested in the broad area of systems and software engineering, especially promoting the rigorous use of software models

• NoSQL• Rest• JSON• Verificación / testing• Versionado• Collaboración

Y aún hay más

Flickr/FlazingoPhotos

Page 39: Modelo, luego existo - René Descartes · Nuestramisión Interested in the broad area of systems and software engineering, especially promoting the rigorous use of software models

http://matt.might.net/articles/phd-school-in-pictures

Me prohibieron utilizar mis 500+ slides de “introduccióna la IDM” /

Page 40: Modelo, luego existo - René Descartes · Nuestramisión Interested in the broad area of systems and software engineering, especially promoting the rigorous use of software models

Model-driven

Engineering

El porqué: Casos de uso

El cómo:Claves parala adopción

El qué:Conceptos

básicos

Page 41: Modelo, luego existo - René Descartes · Nuestramisión Interested in the broad area of systems and software engineering, especially promoting the rigorous use of software models

PERO lo lleva diciendo desde

1985

Page 42: Modelo, luego existo - René Descartes · Nuestramisión Interested in the broad area of systems and software engineering, especially promoting the rigorous use of software models

Adopción MDEAdoption Lifecycle

Page 43: Modelo, luego existo - René Descartes · Nuestramisión Interested in the broad area of systems and software engineering, especially promoting the rigorous use of software models

Adopción MDE

Page 44: Modelo, luego existo - René Descartes · Nuestramisión Interested in the broad area of systems and software engineering, especially promoting the rigorous use of software models
Page 45: Modelo, luego existo - René Descartes · Nuestramisión Interested in the broad area of systems and software engineering, especially promoting the rigorous use of software models

Depende del proyecto:•Objetivo

•Tecnología•Equipo•Tamaño•Dominio

Depende, de qué depende…

Page 46: Modelo, luego existo - René Descartes · Nuestramisión Interested in the broad area of systems and software engineering, especially promoting the rigorous use of software models

Consejo: Evalúa tu equipo

Socio-technicalCongruence:MDE requiere nuevos roles,

nuevas tareas...

Page 47: Modelo, luego existo - René Descartes · Nuestramisión Interested in the broad area of systems and software engineering, especially promoting the rigorous use of software models

Consejo: Educa a tu equipo

Y incluye personas que lo hayan

hecho antes en tu 1er proyecto

Page 48: Modelo, luego existo - René Descartes · Nuestramisión Interested in the broad area of systems and software engineering, especially promoting the rigorous use of software models

Consejo: Sé ágil

Page 49: Modelo, luego existo - René Descartes · Nuestramisión Interested in the broad area of systems and software engineering, especially promoting the rigorous use of software models

Consejo: “Start small”

Size DOESmatter

Page 50: Modelo, luego existo - René Descartes · Nuestramisión Interested in the broad area of systems and software engineering, especially promoting the rigorous use of software models

Consejo: Ten paciencia

Page 51: Modelo, luego existo - René Descartes · Nuestramisión Interested in the broad area of systems and software engineering, especially promoting the rigorous use of software models

Consejo: Que Management te dé su apoyo

No puede ser sólo un experimento que te “dejen”

hacer

Page 52: Modelo, luego existo - René Descartes · Nuestramisión Interested in the broad area of systems and software engineering, especially promoting the rigorous use of software models

Consejo: Los experimentos con gaseosa

Ej: UML es suficiente para la gran mayoría de

proyectos

Page 53: Modelo, luego existo - René Descartes · Nuestramisión Interested in the broad area of systems and software engineering, especially promoting the rigorous use of software models

Consejo: Escoge una herramienta de verdad

Drawingvs

modelingtool

Page 54: Modelo, luego existo - René Descartes · Nuestramisión Interested in the broad area of systems and software engineering, especially promoting the rigorous use of software models

Papyrus• Una herramienta abierta (open-source)

basada en Eclipse para modelaje con UML, SysML y DSLs basados en UML

• Potente consorcio industrial detrás(sostenibilidad)

Page 55: Modelo, luego existo - René Descartes · Nuestramisión Interested in the broad area of systems and software engineering, especially promoting the rigorous use of software models

Papyrus: plataforma

- ...-RT -IM-xtUML -?

Page 56: Modelo, luego existo - René Descartes · Nuestramisión Interested in the broad area of systems and software engineering, especially promoting the rigorous use of software models
Page 57: Modelo, luego existo - René Descartes · Nuestramisión Interested in the broad area of systems and software engineering, especially promoting the rigorous use of software models
Page 58: Modelo, luego existo - René Descartes · Nuestramisión Interested in the broad area of systems and software engineering, especially promoting the rigorous use of software models
Page 59: Modelo, luego existo - René Descartes · Nuestramisión Interested in the broad area of systems and software engineering, especially promoting the rigorous use of software models

http://modeling-languages.com

Page 60: Modelo, luego existo - René Descartes · Nuestramisión Interested in the broad area of systems and software engineering, especially promoting the rigorous use of software models

Let’s work together

(PhDs, Postdocs,

consulting, tech

transfer,...)[email protected]

@softmodeling