4. 4
WHO I AM
● Eric Jan Malotaux
● Software Architect with Ordina
● Trained as a musician and musicologist
● 28 years experience in software development
● Email: emalotau@gmail.com
● Twitter: @EricJanMalotaux
● LinkedIn: ericjanmalotaux
● Blog: http://emalotau.blogspot.nl/
6. 6
● A very succesful mortgage application
● 185 screens
● 100 users
● Quarterly releases
● Sizeable model: 200,000 lines (10Mb) of XMI
● Interfaces to external systems using queues
● Native Windows DLL's for calculations
8. Question:
Will MDD live up to its promise?
“... These platform-independent models document the
business functionality and behavior of an application
separate from the technology-specific code that
implements it, insulating the core of the application from
technology and its relentless churn cycle while enabling
interoperability both within and across platform
boundaries. ...”
– http://www.omg.org/mda/
12. SQL
FAST
metamodel
(schema)
FMA
model
(database)
FMA
user data
expressed in
expressed in
Abstract
Syntax
“Class Tree”
C++
Model
object
graph
expressed in
expressed in
load
FMA
export
(C++)
UML
FAST
metamodel
expressed in
EA C++
import
Ecore
FAST
metamodel
(ecore)
expressed in
EA ecore
export
FMA
model
(xmi)
expressed in
FMA
application
Export
generator
(xtend2)
FMA
generators
(xtend2)
Old
M2
M1
M0
M3
NewIntermediate
(Enterprise Architect)
FMA
generators
(C++)
15. 16
LESSONS LEARNED
The value of an explicit metamodel
●
Help in understanding the model
●
Lots of automated support:
●
Generated export program
●
Generated tree editor
●
Generated model API
●
Model was not so platform-independent as we thought
16. 17
Remaining opportunities
Maintaining the migrated model
●
Maintain the (just once) generated Java application
●
Order of magnitude larger than model → more expensive
●
No more migrations
●
Model is lost forever
●
Keep maintaining the model
●
Can generate other styles of application
●
Use the EMF-generated tree editor
– already as good as, or better than, the Access application
●
Derive an Xtext grammar from the metamodel
– Manual adjustments
– Have a textual DSL almost for free
– Familiar concepts: the metamodel (language) was not changed.
18. Question:
Will MDD live up to its promise?
Answer:
Although the model was not as platform-independent as
we thought, still much easier that plain C++ → Java.
This presentation is tcase study about “Transforming a 15 year old model-driven application from C++ to Java”
Let me first give an overview of my presentation.
First I will introduce myself. Then I will describe the assignment that this presentation is about Since the assignment was essentially a renovation of an existing application, I will describe how renovation of old applications is done in general. Next I will describe how we applied different strategies in succession as we learned on the job. Finally I will try to draw some lessons from the experience and mention a number of problems that we did not yet find a good solution for.
What I learned in those 27 years: - Automated procedures as important as programming skills or architecture - Automated build - Version management - Automated deployment - (Automatic unit testing) - Communication and trust within team Specialties: - Software factories 25+ years - used to be new but now more common - Model-driven code generation 10+ years - Agile Development - eXtreme Programming 10+ years - Scrum 3+ years
What was our assignment?
A very succesful mortgage application - 185 screens (or parts of screens) - 100 users - regular quarterly releases - sizeable model: 200.000 lines, 10Mb of XMI Using a proprietary model-driven C++ generator written in C++ Several interfaces to external systems, queues Several native Windows DLL's for complicated calculations
Scarce expertise - model-driven techniques in general - this particular modeler/generator in particular - C++ Dependent on outdated C++ compiler and libraries Modeler/generator maintained but not further developed: dead end Difficult to offshore Wanted: a regular Java webapplication No code generator - dependency on proprietary tool - Current developers where quite happy with the tool and productive
But in our case we had specification in the form of an executable (therefore correct) model. 1) Write a new C++ generator to generate Java - Problem: large conceptual gap to bridge: - C++ to Java (fluency in both needed) - Different architecture - On top of model driven skills 2) Use Mod4J as intermediate model - Smaller conceptual gap - Built-in Java architecture - Based on written reference architecture 3) Migrate model to EMF for productivity - Better tools - Better software factory 4) Mod4J incompatibly architecture - fat client ↔ layering - COOL language everywhere - lazy loading
Want to use EMF - Need an ecore metamodel - Derive from “Class Tree” - Via Enterprise Architect im/export - Generate an export program - Generate our new application - Loading time: 1,5 second - But initially 25 seconds (!) - Need a HashMap for id's
How to maintain the migrated model: - Use EMF tree editor - already quite good - Derive an Xtext grammar from the metamodel - beautify - DSL for “free” - The language is still the same - Familiar for the maintainers