M2M Transformations and an MDE Application
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.
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:
Yuml returns this absolutely gorgeous diagram:
drawing your own diagrams. When you feel comfortable, proceed
to the next section.
YPL Schema and the YPL2Yuml M2M ToolIn 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
> java Violett.ClassParser X.class.violetMDELite7 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.plThe 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.plWhere:
- X.vpl.pl is the input VPL database
is the output YPL database (whose name need not be specified on
the command line as this is the default naming convention of MDELite).
YPL SchemaHere 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"
% arrow1,2 = V, TRIANGLE, DIAMOND, BLACK_DIAMOND, "" (NONE)
% bentStyle = "", HV, VH, HVH, VHV
Here is the YPL schema:
% yuml class schemaBasically, vBox tuples map to yumlBox tuples, etc. Your Java program M2M.vpl2ypl does this translation.
% type = n (for note), c (for class), i (for interface)
% end1 = <> | ++ | ^ | < | "" (nothing)
% end2 = <> | ++ | ^ | > | "" (nothing)
% lineType = - | -.-
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 ChainYour 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.classWhich 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
of the below in a zip file. The
zip file must unzip into
- Your completed NetBeans Project, with programs M2M.vpl2ypl and M2M.Violet2Yuml passing all regression tests.
- Expect the TA to try some Violet files of his/her own making on your programs.
- A PDF file
(in the required
format) that the
Grader should read to provide any information that is not obvious.
each Violet test file given as a regression test, show its class
diagram and the corresponding class diagram your program produces using
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
No late assignments/submissions will be accepted.