Post on 14-Dec-2014
description
transcript
www.modeliosoft.com
EU projects MODAClouds and JUNIPER –
Writing and testing transformations from abstract
object oriented domain modelsMarcos Almeida, SOFTEAM | ModelioSoftRCIS’13
1
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?
Context: two FP7 projects that just started…
www.modeliosoft.com 3
http://www.modaclouds.eu/ - 318484 http://www.juniper-project.org/ - 318763
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
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
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
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
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
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 (…)
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
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
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
Decomposing transformations
www.modeliosoft.com 13
Persistence Model JPA
Entities Java Classes
Identifiers Attributes
…
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
…
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
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
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
Thank you for your attention!
Marcos Almeida
SOFTEAM | ModelioSoft
marcos.almeida@softeam.fr
SOFTEAM R&D Web Site:
http://rd.softeam.com
ModelioSoft Web Site:
http://www.modeliosoft.com
www.modeliosoft.com 18
M o d e l i n g s o l u t i o n s.