M2M Transformations and an MDE Application

Model-to-model (M2M) transformations in MDE corresponds to database-to-database transformations in MDELite.  In this assignment, you will write a M2M  transformation to map databases of type VPL to databases of type YPL, and use Yuml to display your class diagrams. This will involve writing 2 Java programs.

You are to continue working in pairs.


Yuml is a free web service that draws UML class diagrams given a Yuml input specification.  As this is a for-profit company, the "free" service comes with some strings attached.  Namely, it will produce a pretty class diagram for you provided that your specification is not too complicated.  (I found other problems with Yuml, but this is a story for another day).

Familiarize yourself with Yuml:


YPL Schema and the YPL2Yuml M2M Tool

In assignment P2, you became familiar with the VPL schema.  A database instance of this schema is produced by transforrming an ugly Violet XML document (below X.class.violet) into a VPL database (below X.vpl.pl):
> java Violett.ClassParser X.class.violet
MDELite7 has a tool that transforms a YPL database (below X.ypl.pl)  into a YUML document (below X.yuml.yuml):
> java Yuml.ClassUnParser X.ypl.pl
The transformation chain that we have (and want to implement) is shown below:

Ovals are domains and arrows are total functions. (A total function maps every element in its input domain to some element in the output domain).  Thus, we have  Violett.ClassParser:XmlViolet→VPL, Yuml.ClassUnParser:YPL→Yuml, and what is missing is a tool to implement vpl2ypl:VPL→YPL. Your task is to write a Java program M2M.vpl2ypl that performs the VPL→YPL database translation:
> java M2M.vpl2ypl X.vpl.pl

YPL Schema

Here is the starting VPL schema which you have used before:
% Violet (vpl) class database


% type = c(class),i(nterface),n(ote). packages are skipped


% type1,type2 = c(lass) or i(nterface)
% lineStyle = ""(solid) or "DOTTED"
% bentStyle = "", HV, VH, HVH, VHV


Here is the YPL schema:
% yuml class schema


% type = n (for note), c (for class), i (for interface)


% end1 = <> | ++ | ^ | < | "" (nothing)
% end2 = <> | ++ | ^ | > | "" (nothing)
% lineType = - | -.-

Basically, vBox tuples map to yumlBox tuples, etc. Your Java program M2M.vpl2ypl does this translation.

I give you a NetBeans shell of a project for this assignment.  Use it.  It contains regression tests that your program must satisfy.

Final Step: Write a Java Program to Implement the Translation Chain

Your last step is to write a Java program (whose main method is but a few lines) that implements the entire transformation chain of the above Figure, including your P2 VPL.Conform file to validate a Violet class diagram. Your program is M2M.Violet2Yuml:
> java M2M.Violet2Yuml X.violet.class
Which translates file X.violet.class to file X.yuml.yuml. You will need to use MDELite7's Yuml.ClassUnparser, which maps YPL files to YUML specifications (.ypl.pl .yuml.yuml files). A shell of this program is also available, with regression tests, in the NetBeans shell given above.

What to Submit

All of the below in a zip file. The zip file must unzip into <yourName>/<YourFilesAndDirectories>.
  1. Your completed NetBeans Project, with programs M2M.vpl2ypl and M2M.Violet2Yuml passing all regression tests.

  2. Expect the TA to try some Violet files of his/her own making on your programs.
  3. A PDF file (in the required format) that the Grader should read to provide any information that is not obvious.  For each Violet test file given as a regression test, show its class diagram and the corresponding class diagram your program produces using Yuml

A critical part of any design is clarity and understandability.   Hence, you will be graded on the clarity of your project and its ability to work correctly.  Sloppy code, documentation, or anything that makes grading or understanding your program difficult will cost you points.  Beware, some of these "beauty" points are subjective. 

Remember: No late assignments/submissions will be accepted.