renovating a 15-year old model-driven application

19
Renovating a 15-year old Model-Driven Application Eric Jan Malotaux Software Development Automation 2013, Amsterdam, The Netherlands 2013-05-29 1

Upload: eric-malotaux

Post on 14-Jul-2015

126 views

Category:

Technology


3 download

TRANSCRIPT

Page 1: Renovating a 15-year old Model-Driven Application

Renovating a 15-year old Model-Driven ApplicationEric Jan MalotauxSoftware Development Automation 2013, Amsterdam, The Netherlands2013-05-29

1

Page 2: Renovating a 15-year old Model-Driven Application

Overview

Page 3: Renovating a 15-year old Model-Driven Application

3OVERVIEW

● Who I Am

● The Assignment

● The Strategy

● Lessons Learned

● Remaining opportunities

Page 4: Renovating a 15-year old Model-Driven Application

4WHO I AM

● Eric Jan Malotaux

● Software Architect with Ordina

● Trained as a musician and musicologist

● 28 years experience in software development

● Email: [email protected]

● Twitter: @EricJanMalotaux

● LinkedIn: ericjanmalotaux

● Blog: http://emalotau.blogspot.nl/

Page 5: Renovating a 15-year old Model-Driven Application

The AssignmentTransforming a 15 year old model-driven application from C++ to Java

Page 6: Renovating a 15-year old Model-Driven Application

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

Page 7: Renovating a 15-year old Model-Driven Application

FMAmodel

Load(C++)

FAST“Class Tree”

(C++)

FMAsource(C++)

FMAexecutable

FMAdata

External(MQ) classes

(C++)

FASTframework

(C++)

FMAgenerator

(C++)

given

generated

manual

tools

Legenda

FASTModeler

(MS-Access)

FMADLL

(SQL)

BorlandC++

compiler

Page 8: Renovating a 15-year old Model-Driven Application

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/

Page 9: Renovating a 15-year old Model-Driven Application

The Strategy

Page 10: Renovating a 15-year old Model-Driven Application

Requirements

FASTmodel

(database)

C++implementation

Goals

Mod4Jmogram

(textual DSL)

Javaimplementation

C++ extractor

Xpandgenerator

Legacy application Renovated application

C++ generator C++ generator

FASTmodel(xmi)

C++extractor

Xtend2generator

FASTmodel(xmi)

C++extractor

Xtend2generator

Requirements

Goals

Specifications

Strategy

Page 11: Renovating a 15-year old Model-Driven Application

Migrating the (meta)models

Page 12: Renovating a 15-year old Model-Driven Application

SQL

FASTmetamodel(schema)

FMAmodel

(database)

FMAuser data

expressed in

expressed in

AbstractSyntax

“Class Tree”

C++

Modelobjectgraph

expressed in

expressed in

loadFMA

export(C++)

UML

FASTmetamodel

expressed in

EA C++import

Ecore

FASTmetamodel

(ecore)

expressed in

EA ecoreexport

FMAmodel(xmi)

expressed in

FMAapplication

Exportgenerator(xtend2)

FMAgenerators

(xtend2)

Old

M2

M1

M0

M3

NewIntermediate(Enterprise Architect)

FMAgenerators

(C++)

Page 13: Renovating a 15-year old Model-Driven Application

FASTmetamodel

FMAmodel

Load

FAST“Class Tree”

EnterpriseArchitect

FASTmetamodel

(ecore)

FMAmodel(XMI)

EMF

FASTmodel

Java API

FASTtree editor

FMA(Java)

JNAadapters(Java)

FASTframework

(Java)

External(MQ) classes

(Java)

maven/javac/build

FMA(JWS/jar)

FMAdata

FMAexample(Java)

External(MQ) classes

(C++)

FASTframework

(C++)

Extractorgenerator(xtend2)

FMAgenerator(xtend2)

given

generated

manual

tools

Legenda

Modeler(MS-Access)

Old

Temporary

New

Extract

Page 14: Renovating a 15-year old Model-Driven Application

Lessons Learned&Remaining Opportunities

Page 15: Renovating a 15-year old Model-Driven Application

16LESSONS LEARNEDThe 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

Page 16: Renovating a 15-year old Model-Driven Application

17Remaining opportunitiesMaintaining 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.

Page 17: Renovating a 15-year old Model-Driven Application

FASTmetamodel

(ecore)

FMAmodel(XMI)

EMFgenerator

FASTmodel

Java API

FASTtree-editor

FMA(Java)

JNAadapters(Java)

FASTframework

(Java)

External(MQ) classes

(Java)

maven/javac/build

FMA(JWS/jar)

FMAdata

FMAgenerator(xtend2)

given

generated

manual

tools

Legenda

FMAmodel(XMI)

FASTDSL

(xtext)

FMAmodel(text)

Page 18: Renovating a 15-year old Model-Driven Application

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.

Page 19: Renovating a 15-year old Model-Driven Application

20

www.ordina.nl