Renovating a 15-year old Model-Driven Application

Post on 14-Jul-2015

124 views 3 download

Tags:

Transcript of 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

Overview

3OVERVIEW

● Who I Am

● The Assignment

● The Strategy

● Lessons Learned

● Remaining opportunities

4WHO 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/

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

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

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

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/

The Strategy

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

Migrating the (meta)models

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++)

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

Lessons Learned&Remaining Opportunities

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

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.

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)

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.

20

www.ordina.nl