presentation - DSM Forum

streakconvertingSoftware and s/w Development

Dec 13, 2013 (3 years and 3 months ago)

48 views

Model
-
View
-
Controller
Architecture Specific

Model Transformation

October 25, 2009

DSM'09

1

Hiroshi Kazato
1,2
, Rafael Weiss
1
, Shinpei Hayashi
1
,

Takashi Kobayashi
3

and Motoshi Saeki
1


1

NTT DATA CORPORATION

2

Tokyo Institute of Technology


{kazato,rweiss,hayashi,saeki}@se.cs.titech.ac.jp

3

Nagoya University


tkobaya@is.nagoya
-
u.ac.jp

Agenda


Introduction


Motivating

Example


Solution: Pivot Technique


MVC
-
specific

Model

Transformation


PIM

Profile


PIM
-
to
-
PSM

Transformation


Process & Tool Chain


Case

Study


Related

Work


Conclusion


October 25, 2009

DSM'09

2

Introduction


Various

platforms

(frameworks

and

libraries)

can

be

used

to

build

user
-
interactive

application


e.g.

EJB,

Struts,

Spring,

Hibernate,

JSF


Coming one after another, introducing somehow
familiar concepts in brand
-
new names


Generative UML/MDA tools seemed promising to
bring interoperability of design

models


e.g.

AndroMDA
,
openArchitectureWare


UML profiles and code generators took over from
platforms

October 25, 2009

DSM'09

3

Motivating

Example


Model

migration:

EJB


Spring

+

Hibernate

October 25, 2009

DSM'09

4

(a)

UML

with

EJB

profile

(b)

UML

with

Spring

+

Hibernate

profiles

Solution:

Pivot

Technique


Provide

an

intermedieate

metamodel

(“pivot”)

and

its

mappings

to

concrete

metamodels.


How

can

I

define

such a

pivot

for

user
-
interactive

applications?

October 25, 2009

DSM'09

5

mm
pv

mm
3

mm
2

mm
1

m
pv

m
3

m
2

m
1

Instance of

Instance of

Instance of

instance of

“pivot”

metamodel

concrete

metamodels

model
-
to
-
model

transformation

Model
-
View
-
Controller


Architecture

style

which

defines

typical structure and
behavior of a

user
-
interactive application


«model» provides core functionalities

(i.e.

logic

and

data)


«view» shows

information to a

user


«controller» interprets user operations

as a request to
perform some

functionality

on the «model»

October 25, 2009

DSM'09

6

Buschmann

et

al.

“Pattern
-
Oriented Software
Architecture: A System of Patterns”,

Wiley & Sons, 1996

+initialize(model : Model, view : View)

+handleEvent()

+update()

Controller

-
coreData

+attach(observer : Observer)

+detach(observer : Observer
)

+notify()

+getData()

+service()

Model

+update()

Observer

+initialize(model : Model)

+makeController()

+activate()

+display()

+update()

View

-
myController

-
myView

-
myModel

Categorizing

Platforms

Design

Concept

Target

Platform

Stereotype

used

by

Code

Generator

Source

Code

Model

Java

Object

Serialization

«JavaObject»

POJO

(implementing

java.io.Serializable)

EJB

«Entity»

CMP

Entity

Bean

Hibernate

«Entity»


POJO

+

XML

(Hibenate

Mapping)

View

Swing

«JavaObject»

POJO

(Swing

Component)

Struts

«ActionForm»

JSP

+

ActionForm

JSF

«ManagedBean»

XHTML

+

ManagedBean

Controller

POJO

«JavaObject»

POJO

EJB

«Session»

Stateless

Session

Bean

Struts

«Action»

Action

Spring

«Service»

POJO

October 25, 2009

DSM'09

7

PIM

Modeling


Restrict desgin

model into
Model
-
View
-
Controller

architecture style


MVC

Profile

(“ACCURATE “)


«model»


«view»


«controller»


«external»

October 25, 2009

DSM'09

8

PIM
-
to
-
PSM

Transformation

mapping Class::toPSMClass() : Class {


name := self.name.firstToUpper();



isAbstract := self.isAbstract;



visibility := self.visibility;



...



ownedAttribute := self.ownedAttribute
-
>map



toProperty()
-
>asOrderedSet();



ownedOperation := self.ownedOperation
-
>map



toOperation()
-
>asOrderedSet();

}


mapping Class::toService():Class

inherits Class::toPSMClass

when{


self.isStereotypeApplied(ACCURATE::controller)

}{


end { result.applyStereotype(Spring2::Service);

}

}

October 25, 2009

DSM'09

9

Basic

mapping

Modify

stereotype

Process

&

Tool

Chain

October 25, 2009

DSM'09

10

MagicDraw

M2M

QVTo

oAW

Fornax
-
Platform

Case

Study


Address

book


create/save/open

address

book


add/edit/delete

entries

October 25, 2009

DSM'09

11

First

Generation

October 25, 2009

DSM'09

12

PIM

Mark

PSM

Mark

PSI

Type

Generated

Preserved

«model»

«Entity»

POJO

6

0

DAO

6

0

Hibernate

Settings

4

0

«view»

«JavaObject»

Swing

9

0

«controller»

«JavaObject»

POJO

6

0


Platform:

Hibernate

+

Swing

+

POJO

Second

Generation

October 25, 2009

DSM'09

13

PIM

Mark

PSM

Mark

PSI

Type

Generated

Preserved

«model»

«Entity»

POJO

4

2

DAO

4

2

Hibernate

Settings

4

0

«view»

«SpringBean»

Swing

6

3

Spring

Settings

1

0

«controller»

«Service»

POJO

4

2

Spring

Settings

1

0

N/A

N/A

Spring

Context

Helper

2

0

Spring

Settings

2

0


Platform:

Hibernate

+

Swing

+

Spring

Related

Work


ATL

Project

[7]


Pivot

technique


ATLAS

transformation
language


GignoMDA

[11]


Defines

PIM profiles

for

database

application


Generate

Eclipse

RCP

based

database

application

using

AndroMDA


Focusing

on

cross
-
layer

optimizaton

of

database

applications


October 25, 2009

DSM'09

14

Conclusion


Summary


Defined a “pivot” for

MVC

based

application

using a
UML profile and QVT

transformations


Employed MVC concepts in order to categorize
various platforms and find

transformation

mappings


Future

works


Further

evaluation


Platform

decision

model


Interoperation

with

coding

(e.g.

reverse

mapping)

October 25, 2009

DSM'09

15

Thank

you.


Any

questions?

October 25, 2009

DSM'09

16