Comparing MDELite with ATL's Families to Persons Demo
The
Atlas Transformation Language (ATL) is a first-generation MDE language
for writing model-to-model (M2M) transformations. As such it is
pioneering work against which future transformation languages
should be compared. We invite readers to visit and digest the ATL
example at:
http://wiki.eclipse.org/ATL/Tutorials_-_Create_a_simple_ATL_transformation
Here is an MDELite implementation of the Familes to Persons example. Here is the input database:
:::test/LectureExamples/Correct/inria.families.pl:::
and here is the translated database, the output of the Families2Persons transformation:
:::test/LectureExamples/Correct/inria.persons_1.pl:::
In the following sections, I explain the Families2 Persons transformation program.
1. Initialization
The
command-line input to the program is the input database (whose contents
I listed above). Read the command line, extract the input
file (database) name, and locate the output schema file:
---init---
2. Read in Database Input Tables
Next, read in the database, and get the family and member tables:
---readdb---
3. Read in Schema and Initialize Empty Output Tables
Read
in the persons schema, create a new (and empty) database instance of
this schema. Get the empty male and female tables in which we are
to populate tuples:
---createdb---
4. Perform the Model-to-Model Transformation
The
join of the family and members table connects individuals with their
family. Male tuples are fathers and sons of families; Female
tuples are mothers and daughers of families. Four lines compute all male and female tuples:
---xform---
The above code, as in the ATL example, uses a helper function. It takes a table and a join tuple (which belongs to
the cross-product of the member and family database) as input.
From the tuple I extract the member's identifer, first name, and
last name. The first and last names are concatenated, and to the
input table, I add a tuple whose field values are member identifier,
first+last name:
---helper---
An alternative -- and equally as general -- is to define correspondences between columns of tuples of dfferent schemas:
---alternative---
5. Print the Persons Database
Is all that remains to do:
---print---
Homework
Compare the above solution to that of ATL. I argue MDELite has the following advantages:
- MDE programmers don't have to learn yet another language to write M2M transformations,
- MDE programmers don't have to learn yet another language to write Model constraints,
- MDE
programmers don't have to maintain a customized language -- the language
of MDELite is Java 8, and Oracle does a better job of maintaining Java
than any university-based research center could, and
- MDELite relies on fundamental concepts in computer science -- relational databases -- and reduces MDE complexity.