Using Bluprint with MagicDraw

Bluprint is a Java application dependent upon Java 1.5.  It is assumed that this is installed and running on your system.

The following steps describe how to develop Agile-MDA projects using Bluprint with MagicDraw. Bluprint has initially been developed and tested in conjunction with MagicDraw.  (We’ll add further pages for other tools as they are validated with Bluprint).

1.Download Bluprint (bluprint.jar).

2.Create a new project directory, myproj and two sub-directories uml and src.  You can name these directories anything you want, however we will consistently use these names within these instructions.

3.Start MagicDraw. You can obtain a copy of the community edition from here.

4.You can start modelling straight away, however it is recommended to start from the base Bluprint project (bluprint_base.mdzip).  This contains declarations for java.lang, java.util and introduces bluprint specific stereotypes.

5.  Open the base project within MagicDraw.

6.  Add your own implementation classes within MagicDraw.  Create your new classes and packages under Data.

7.Save your model with a new name, we’ll call this myproj.

8.Export the model, in MagicDraw via File -> Export -> EMF2 UML (v1.x) XMI, into the myproj/uml directory.  Confirm all the prompts presented.

9.Now that you have exported your model you can in invoke Bluprint.  Change directory to myproj.  Start a shell and execute the following

java –jar bluprint.jar uml/uml/myproj.uml2 uml/uml src

As this is the first time, Bluprint has been run, Bluprint will create directories and files corresponding to your model.

10.You can now edit the code that has been generated.  Bluprint will create stub implementations for constructors and any methods that you defined in your model.  Any changes that you make will be preserved during subsequent iterations.

11.As you iterate between your model and code, you will want to generate new classes, interfaces and enumerations     added to your model.  To do this you invoke Bluprint but provide an additional parameter.  This parameter tells Bluprint that you want to merge code with the model.  In our example we make this the same directory as our output directory.

java –jar bluprint.jar uml/uml/myproj.uml2 uml/uml src src