+ All Categories
Home > Technology > EU projects MODAClouds and JUNIPER – Writing and testing transformations from abstract object...

EU projects MODAClouds and JUNIPER – Writing and testing transformations from abstract object...

Date post: 14-Dec-2014
Category:
Upload: marcos-almeida
View: 60 times
Download: 0 times
Share this document with a friend
Description:
Softeam is a France based medium sized company, with more than 20 years of experience in Model Driven Engineering (MDE) solutions, consulting, training. Moreover, is is, and since 1994, a voter in the Object Management Group, in which it takes part of the standardization of languages such as UML and SysML. Softeam also has an active participation in EU research projects such as X and Y. Moreover it currently takes part of the EU projects MODAClouds and JUNIPER which intend to simplify the development of cloud internet applications by the use of MDE approaches and tools. The core of the MDE approach consists in having models play an important role in the development. Series of model transformations iteratively bring high abstract model to reality by semi-automatically generating more detailed and low level models that are then, in the end of the process, transformed into running code. In both the MODAClouds and JUNIPER, Softeam is involved in producing transformations that map abstract domain models of web applications into specific database tools. Such transformations are not trivial because they involve models that follow different representation paradigms. An industrial quality approach is then necessary not only for writing such transformation but for making sure that the written code is correct. In this talk, we are going to describe our initial experience on writing and testing our transformations from abstract object oriented domain models into JPA annotated Java classes. The Java Persistence API (JPA) was designed to annotate Java classes with pieces of information that help a persistence engine to map them into relational databases. The complexity involved in such transformation lead us to develop an architecture that allowed for its easy unit testing. The main topic of this talk will therefore be this architecture and the tools that allowed us to write and test this transformation.
Popular Tags:
19
www.modeliosoft.com EU projects MODAClouds and JUNIPER Writing and testing transformations from abstract object oriented domain models Marcos Almeida, SOFTEAM | ModelioSoft RCIS’13 1
Transcript
Page 1: EU projects MODAClouds and JUNIPER – Writing and testing transformations from abstract object oriented domain models

www.modeliosoft.com

EU projects MODAClouds and JUNIPER –

Writing and testing transformations from abstract

object oriented domain modelsMarcos Almeida, SOFTEAM | ModelioSoftRCIS’13

1

Page 2: EU projects MODAClouds and JUNIPER – Writing and testing transformations from abstract object oriented domain models

What’s this presentation about?

•This is not a presentation about solutions but about problems.

•Future of Internet = Platform Fragmentation

•MDE Approach =

www.modeliosoft.com 2

BusinessObjects Transformation

HDFS

MySQL

MongoDB

Abstract ModelsSpecific Models / code

Transformation

Transformation

PROBLEM!!PROBLEM!!Given this fragmentationfragmentation:

How to writewrite and testtest these transformations?

Page 3: EU projects MODAClouds and JUNIPER – Writing and testing transformations from abstract object oriented domain models

Context: two FP7 projects that just started…

www.modeliosoft.com 3

http://www.modaclouds.eu/ - 318484 http://www.juniper-project.org/ - 318763

Page 4: EU projects MODAClouds and JUNIPER – Writing and testing transformations from abstract object oriented domain models

What’s the “Future of Internet” for MODAClouds?

www.modeliosoft.com 4

The Cloud

The Cloud

The Cloud

The Cloud

The cloud? No!

Multiple clouds,Multiple providers,Fragmentation!

Our mission: •Develop applications in a cloud independent way•Provide support for app monitoring, adaption and migration

Page 5: EU projects MODAClouds and JUNIPER – Writing and testing transformations from abstract object oriented domain models

What’s the “Future of Internet” for JUNIPER?

• The main keyword: Big Datao Multiple streamso Multiple typeso Real-time constraints

• Current state of the art: NoSQLo Pros

• Optimized for non-relational data• Optimize query engines for performance not for expressivity

o Cons• The code is “ the model” • How to deal with the different NoSQL databases?

• Our missiono Modeling support for non relational & real-time big data application

www.modeliosoft.com 5

Page 6: EU projects MODAClouds and JUNIPER – Writing and testing transformations from abstract object oriented domain models

The main problem is FRAGMENTATIONFRAGMENTATION!

•Many different database management systemso Ex:

• MySQL (www.mysql.com/), • Big Table (http://research.google.com/archive/bigtable.html)• SimpleDB (http://aws.amazon.com/simpledb/)• Memcached (http://memcached.org/)• …

•Many underlying data representation paradigmso Ex:

• Relational Databases• Key-value Stores• Object-oriented Databases• Big Tables• …

www.modeliosoft.com 6

Page 7: EU projects MODAClouds and JUNIPER – Writing and testing transformations from abstract object oriented domain models

The basis of our solution is MDE… Why?

•Separating the problem from the solution

•Fostering automationo Analysiso Code generation

www.modeliosoft.com 7

BusinessObjects Transformation

HDFS

MySQL

MongoDB

Abstract ModelsSpecific Models / code

Transformation

Transformation

Page 8: EU projects MODAClouds and JUNIPER – Writing and testing transformations from abstract object oriented domain models

What do we get from MDE?

Pros•D

esign data once, store everywhere!

•Write your transformation once, transform anything!

Cons•T

ransformations are hard to write…

•How to make sure they are CORRECT? i.e.– Is there any data/semantic

loss?

www.modeliosoft.com 8

Page 9: EU projects MODAClouds and JUNIPER – Writing and testing transformations from abstract object oriented domain models

Understanding the problem… Why is it so HARD? (1/3)

•Target Technologies based on different paradigms

•Example:

www.modeliosoft.com 9

A

B

JPA@Entitypublic class A { @Basic public B getB(){ … }…}

SQLcreate table A (…)create table B (…)create table A_B (…)

Page 10: EU projects MODAClouds and JUNIPER – Writing and testing transformations from abstract object oriented domain models

Understanding the problem… Why is it so HARD? (2/3)

•Target structure is variable

•Example:

www.modeliosoft.com 10

A

B

ER

NoSQL

A

BAB

Here A and B are

independent entities

Here, for performance reasons, B is

embedded in AA

B

Page 11: EU projects MODAClouds and JUNIPER – Writing and testing transformations from abstract object oriented domain models

Understanding the problem… Why is it so HARD? (3/3)

•Different implementations support different features

•Example:

www.modeliosoft.com 11

A

B

JPAIn JPA inheritance is usually implemented as

an extra column with a type

x:int y:string Disc(?):int(?)

Hibernate: ignores the

column

Hibernate: ignores the

column

Toplink: ignores its

type

Toplink: ignores its

type

Page 12: EU projects MODAClouds and JUNIPER – Writing and testing transformations from abstract object oriented domain models

Our experience

•Just in the beginning

•Some experimentso Persistence Model JPA x SQL

•Current approach:o Decomposing transformationso Dealing with variability by replacing sub-transformationso Unit testing sub-transformations

• Automated Tests– 90 JUnit Tests

• Manual Integration Test – ~100 Tests

www.modeliosoft.com 12

Page 13: EU projects MODAClouds and JUNIPER – Writing and testing transformations from abstract object oriented domain models

Decomposing transformations

www.modeliosoft.com 13

Persistence Model JPA

Entities Java Classes

Identifiers Attributes

Page 14: EU projects MODAClouds and JUNIPER – Writing and testing transformations from abstract object oriented domain models

Dealing with variability by replacing sub-transformations

www.modeliosoft.com 14

Persistence Model JPA (JSR 317)

Entities Java ClassesEntities Java Classes

Identifiers Attributes

Persistence Model JPA (Hibernate)

Entities Java ClassesEntities Java Classes

Identifiers Attributes

Page 15: EU projects MODAClouds and JUNIPER – Writing and testing transformations from abstract object oriented domain models

Unit testing sub-transformations

www.modeliosoft.com 15

+ at : Integer

TransformationInput Output

@Basic(fetch=FetchType.LAZY)private Integer at;

@Basicprivate Integer at;

Desired output

Obtained output

Page 16: EU projects MODAClouds and JUNIPER – Writing and testing transformations from abstract object oriented domain models

Limitations

•Actual tools do not behave exactly as expected…o Each tool interprets the outputs in a different wayo The range of acceptable outputs may vary from a tool to another

•Integration Test Involves interfacing with complex codeo Modelio, testing databases (MySQL…), Different JPA implementations (Hibernate Eclipse

Link, TopLink…)

www.modeliosoft.com 16

TransformationTransformationInputInput OutputOutput

Tool 1

Tool 2

Page 17: EU projects MODAClouds and JUNIPER – Writing and testing transformations from abstract object oriented domain models

Conclusion

•We focus on MDE for future of the internet applications

•But in practice… MDE needs to support to the platforms supporting these applications…

•Limitations, Limitations, Limitations…o Fragmentation x Integration Testing

•Problemso Too many different targets

• How to test such transformations?• How to interface with complex software?• How to reduce manual work?

www.modeliosoft.com 17

Page 18: EU projects MODAClouds and JUNIPER – Writing and testing transformations from abstract object oriented domain models

Thank you for your attention!

Marcos Almeida

SOFTEAM | ModelioSoft

[email protected]

SOFTEAM R&D Web Site:

http://rd.softeam.com

ModelioSoft Web Site:

http://www.modeliosoft.com

www.modeliosoft.com 18

Page 19: EU projects MODAClouds and JUNIPER – Writing and testing transformations from abstract object oriented domain models

M o d e l i n g s o l u t i o n s.


Recommended