Create PersonVO using MagicDraw

This page provides directions to create the PersonVO using MagicDraw. The model is shown below for your reference.

  1. In the TimeTracker model create a package called vo under org.andromda.timetracker . We will create our value objects in this package.
  2. In the Containment Tree on the left, right-click on the vo package and select New Diagram > Class Diagram. Type in Value Objects as the name of this diagram and click OK. The diagram is created and opened in a new window.
  3. From the Containment Tree on the left, drag the Person class on to the diagram. Warning: It is important to bring in the existing Person class from the domain package into this diagram. DO NOT create a new Person class in this diagram. Doing so will create a new class in the vo package - this is not our intention. All we need is a reference to the existing Person class in the domain package.
  4. Add a new class to the diagram and name it PersonVO .
  5. Add the stereotype called ValueObject to PersonVO .
  6. Add four attributes to PersonVO as shown above.
  7. Select the dependency relationship from the toolbar. Now left-click the mouse on the Person class, drag it to the PersonVO class and release the mouse. A dependency relationship is added between the two classes.
  8. Add a new class to the diagram and name it PersonVO[] .
  9. Make sure your class diagram matches the one shown above.
  10. Save the model by selecting File > Save Project.

We are now ready to generate code for the PersonVO value object. Please go back to the main tutorial page and continue from where you left off.