MDA is Not for Dummies
The OMG has created a standard for MDDs: MDA. It recommends by the way the use of the following languages for implementations:
- UML for modeling
- MOF for metamodelimg
- OCL for model constraints checking
- QVT for model transformations
- MOFM2T for templates
- ...
There are some frameworks that follow more or less these recommendations but the amount of knowledge needed to master them and the delay needed to see the investment return simply discourage a lot of people. Yet MDA should have been systematically used in a perfect world since it is the natural evolution of software production systems.
GenerateXY: Nothing New Under the sun
With GenerateXY, you follow the same MDA approach but by reusing your knowledge to implement technical details. With this knowledge, you can create models and metamodels, check model constraints, do model-to-model and model-to-text transformations, reverse-engineering and model maintenance, all in a uniform and integrated manner:
- XPath is used for both templating, transformation logic and constraints
- XML/XSD concepts (element, attribute, complex type, ...) are used for modeling, metamodeling and mappings
- Tools for reverse-engineering and model maintenance are built using GenerateXY generators
Example
Let's see how we would implement a simple application that is defined by a PIM (Domain), a PSM (DB), a model-to-model transformation between the PIM and the PSM, and model-to-text transformation between the PSM and the code (simple SQL).
1) Using a MDA-compliant Tool
The metamodel

The model constraints
Context Entity inv:
attributes->isUnique(name)
Context Table inv:
columns->isUnique(name)
Model-to-model transformation specification: transform a Domain model to a relational DB model
transformation Domain2DB(in dom: Domain, out db: DB);
main() {
var e := dom.rootObjects![Entity];
e.map Entity2Table();
}
mapping Entity::Entity2Table(): Table {
name := self.name;
columns := properties->collect(p | Property2Column(p));
columns += Column {name=self.name+'_id',type='NUMBER'};
}
mapping Property::Property2Column(): Column {
name := self.name;
type := self.type;
}
Model-to-text transformation specification: transform the relational DB model into a DDL file
[module DDLgen(DB)/]
[template public SchemaToDDL (s: Schema)]
[for (t:Table | s.table)]
[TableToDDL(t)/]
[/for]
[/template]
[template public TableToDDL(t: Table)]
CREATE TABLE [t.name/] (
[for (c:Column|t.column) separator(',')]
[c.name/] [c.type/]
[/for]
);
[/template]
[/module]
2) Using GenerateXY
The metamodel + constraints specification using XPath and a XSD-like language

Model-to-model transformation specification: transform a Domain model to a relational DB model
Model-to-text transformation specification: transform the relational DB model into a DDL file
No More Duplicate Languages!
The XML standard has been created with some languages for handling most of the needs that come from the use of structure languages: XPath for query/navigation, XSLT/XQuery for transformations, XSD for constraints. These languages are model-agnostic: they can be used to manipulate any kind of structured model. Why continuously reinvent the wheel by creating new languages that do exactly the same job that existing languages already do (E.g.: OCL = XPath)? For very specific needs, libraries or extensions could be added to existing languages. The C++, Java, C# languages are not the best OO languages but they succeeded mainly because they were extensions of the popular C language.
Just a little thought that I wanted to share...
References