reverse and forward transformation chain - summersoc.eu · hugo brunelière, jordi cabot, grégoire...

16
Reverse and Forward Transformation Chain 9th Symposium and Summer School On Service- Oriented Computing Heraklion, Crete, Greece 01-07-15

Upload: dangkiet

Post on 09-Apr-2019

215 views

Category:

Documents


0 download

TRANSCRIPT

Reverse and Forward

Transformation Chain

9th Symposium and Summer School On Service-Oriented Computing

Heraklion, Crete, Greece 01-07-15

JUMP: Discover Libraries

It allows to extract UML Profiles from Java annotations – Example shown: JPA Library

– To execute it: right click on

the jpa2 project and select

Model Discovery Toolbox ->

UML Profile Discovery

– More UML Profiles have been discovered by JUMP • They can be installed as Eclipse plugins

• https://code.google.com/a/eclipselabs.org/p/uml-profile-store/source/browse/#git%2FUMLProfiles

Alexander Bergmayr, Michael Grossniklaus, Manuel Wimmer, Gerti Kappel: JUMP - From Java Annotations to

UML Profiles. MoDELS 2014: 552-568 Alexander Bergmayr, Michael Grossniklaus, Manuel Wimmer, Gerti Kappel: Bridging Java Annotations and

UML Profiles with JUMP. Demos@MoDELS 2014

output (UML Profile)

input (JPA Library)

Snapshot of Collected UML

Stereotypes - JPA

JUMP: Discover PSM + Libraries (RE)

Execute JUMP on the petstore-app

– In order to execute it, right click on the

petstore-app and select

Model Discovery Toolbox ->

Profiled UML Model Discoverty

output (PSM of the Petstore)

input (Petstore application)

output (Profile with stereotypes of the Petstore)

Hugo Brunelière, Jordi Cabot, Grégoire Dupé, Frédéric Madiot: MoDisco: A model driven reverse engineering

framework. Information & Software Technology 56 (8): 1012-1032 (2014)

Cloudifying through JUMP

Composition Composition

Precise Multiplicity

Order - orderId: long [0..1] {id}

Address Orderline

- orderLines [1..*] - deliveryAddress [0..1]

- street: String [0..1]

Sliced Domain Classes at PIM Level

- lineId: long [0..1] {id}

RE Scenario PSM2PIM

«Entity» Order

«Id» - orderId: long [0..1]

«Embed» Address

- orderLines [0..1] - deliveryAddress [1..*]

- street: String [0..1]

«Entity» OrderLine

«Id» - lineId: long [0..1]

«Profile» Objectify

Annotated Domain Classes at PSM Level

cloudify

FE Scenario PIM2PSM

«Profile Application»

Identifier

Identifier

«Entity» Order

«Id» - orderId: long [0..1]

«Entity» OrderLine

«Embeddable» Address

[0..1] «Embedded» - deliveryAddress

- street: String [0..1]

ShoppingCart - order

[0..1]

«Id» - lineId: long [0..1]

«Profile» JPA

«Profile Application»

Annotated Application Classes at PSM Level

«Profile Application»

«Profile» Validation

«OneToMany»{cascade=[All]} «Size»{min=1}

[0..*] - orderLines

Source code Generated Code

UML Class Diagram

Cloudifying through JUMP

Source code

UML Class Diagram

1. Understanding (I) (RE)

Based on the JPA

annotations, we

are interested

only in the

domain model

launch configuration

output (Sliced PSM of the Petstore containing the domain model)

input (PSM of the Petstore) Some profiles of the UML Profile Store are also taken as input

Cloudifying through JUMP (1)

«Entity» Order

«Id» - orderId: long [0..1]

«Entity» OrderLine

«Embeddable» Address

[0..1] «Embedded» - deliveryAddress

- street: String [0..1]

ShoppingCart - order

[0..1]

«Id» - lineId: long [0..1]

«Profile» JPA

«Profile Application»

Annotated Application Classes at PSM Level

«Profile Application»

«Profile» Validation

«OneToMany»{cascade=[All]} «Size»{min=1}

[0..*] - orderLines

Source code

UML Class Diagram

2. Understanding (II) (RE)

We want to obtain

a PIM from the PSM

– Remove all

stereotypes

– Turn some plain

associations into

composition

associations Input (Sliced PSM of the Petstore containing the domain model)

Output (PIM of the Petstore containing the domain model)

launch configuration

Cloudifying through JUMP (2)

Composition Composition

Precise Multiplicity

Order - orderId: long [0..1] {id}

Address Orderline

- orderLines [1..*] - deliveryAddress [0..1]

- street: String [0..1]

Sliced Domain Classes at PIM Level

- lineId: long [0..1] {id}

RE Scenario PSM2PIM

Identifier

Identifier

«Entity» Order

«Id» - orderId: long [0..1]

«Entity» OrderLine

«Embeddable» Address

[0..1] «Embedded» - deliveryAddress

- street: String [0..1]

ShoppingCart - order

[0..1]

«Id» - lineId: long [0..1]

«Profile» JPA

«Profile Application»

Annotated Application Classes at PSM Level

«Profile Application»

«Profile» Validation

«OneToMany»{cascade=[All]} «Size»{min=1}

[0..*] - orderLines

Source code

UML Class Diagram

3. Modernisation (I) (FE)

Refine the PIM

into a PSM cloud-

compatible

– Addition of the

Objectify Profile

Input (PIM of the Petstore containing the domain model)

Output (PSM of the Petstore domain model with stereotypes from Objectify)

launch configuration

Snapshot of Collected UML

Stereotypes - Objectify

4. Modernisation (II)(FE)

The PSM is

further refined

by adding

service classes

– They contain

Objectify

instructions

Input (PSM of the Petstore domain model with stereotypes from Objectify)

Output (PSM of the Petstore domain model with service classes)

launch configuration

Cloudifying through JUMP (3-4)

Composition Composition

Precise Multiplicity

Order - orderId: long [0..1] {id}

Address Orderline

- orderLines [1..*] - deliveryAddress [0..1]

- street: String [0..1]

Sliced Domain Classes at PIM Level

- lineId: long [0..1] {id}

RE Scenario PSM2PIM

«Entity» Order

«Id» - orderId: long [0..1]

«Embed» Address

- orderLines [0..1] - deliveryAddress [1..*]

- street: String [0..1]

«Entity» OrderLine

«Id» - lineId: long [0..1]

«Profile» Objectify

Annotated Domain Classes at PSM Level

cloudify

FE Scenario PIM2PSM

«Profile Application»

Identifier

Identifier

«Entity» Order

«Id» - orderId: long [0..1]

«Entity» OrderLine

«Embeddable» Address

[0..1] «Embedded» - deliveryAddress

- street: String [0..1]

ShoppingCart - order

[0..1]

«Id» - lineId: long [0..1]

«Profile» JPA

«Profile Application»

Annotated Application Classes at PSM Level

«Profile Application»

«Profile» Validation

«OneToMany»{cascade=[All]} «Size»{min=1}

[0..*] - orderLines

Source code

UML Class Diagram

5. Code Generation (FE)

Extension of the

Acceleo UML2

to Java code

generator

launch configuration

Input (PSM of the Petstore domain model with service classes)

Output (auto-generated code of the Petstore)

Cloudifying through JUMP (5)

Composition Composition

Precise Multiplicity

Order - orderId: long [0..1] {id}

Address Orderline

- orderLines [1..*] - deliveryAddress [0..1]

- street: String [0..1]

Sliced Domain Classes at PIM Level

- lineId: long [0..1] {id}

RE Scenario PSM2PIM

«Entity» Order

«Id» - orderId: long [0..1]

«Embed» Address

- orderLines [0..1] - deliveryAddress [1..*]

- street: String [0..1]

«Entity» OrderLine

«Id» - lineId: long [0..1]

«Profile» Objectify

Annotated Domain Classes at PSM Level

cloudify

FE Scenario PIM2PSM

«Profile Application»

Identifier

Identifier

«Entity» Order

«Id» - orderId: long [0..1]

«Entity» OrderLine

«Embeddable» Address

[0..1] «Embedded» - deliveryAddress

- street: String [0..1]

ShoppingCart - order

[0..1]

«Id» - lineId: long [0..1]

«Profile» JPA

«Profile Application»

Annotated Application Classes at PSM Level

«Profile Application»

«Profile» Validation

«OneToMany»{cascade=[All]} «Size»{min=1}

[0..*] - orderLines

Generated Code Source code

UML Class Diagram