Violet2OOSchema Tool


Normally, an MDELite database schema is simple enough to be written manually.  Some may prefer to draw a UML diagram and have that be translated to a schema.  The Violet2OOSchema tool translates a Violet class diagram file (X.class.violet) into an MDELite OO schema file (X.ooschema.pl).

1. Rules for Drawing OO Schemas in Violet


Violet2OOSchema requires you to follow some rules when drawing class diagrams.  They are:


oodb(wAbs,[Tree,Node,Interior]).

abs_table(Tree,[id,name]).
table(Node,[]).
table(Interior,[contains:optional Tree]).

subtable(Tree,[Interior,Node]). 



2. Invoking Violet2OOSchema

 Given the families.class.violet file (whose jpg representation is):

You invoke Violet2OOSchema from the command line as:
C>java MDELite.Violet2OOSchema

Usage: MDL.Violet2OOSchema X.class.violet [X.ooschema.pl] translate X.class.violet to X.ooschema.pl

C>java MDELite.Violet2OOSchema families.class.violet
families.schema.pl produced

The MDELite schema that is produced is:
dbase(families,[Member,Family]).

table(Member,[id,"firstName",familySon:Family,familyDaughter:Family]).
table(Family,[id,"lastName",mother:Member,father:Member]).