Create Timecard Entity using ArgoUML

This page provides directions to create the Timecard entity using ArgoUML along with its associations to the Person entity. The model is shown below for your reference.

  1. In the TimeTracker model open the Domain Objects diagram. This diagram already contains the Person class.
  2. Now add the Timecard class to the diagram and set its stereotype to Entity.
  3. Next we need to add the status attribute to Timecard. However note that status is of type TimecardStatus which is an enumeration. We must define TimecardStatus first. So create a class called TimecardStatus. Give it a stereotype of Enumeration. Add four attributes to it representing the enumeration values. We give each attribute an initial value which is a string with its name in uppercase (ie DRAFT, SUBMITTED, APPROVED, and REJECTED) These values can't be entered directly on the diagram, so type them into the Initial Value field on the property panel for each attribute. Now that we have defined TimecardStatus, we can add the status attribute to Timecard as shown above.
  4. Next add the begDate and comments attributes to Timecard.
  5. Now we must add the association between Timecard and Person. To do this, use the Association tool in the toolbar (5th icon from the left). Click on the the downward pointing triangle just to its right to activate the pulldown menu and select the directional association tool with the arrowhead in place of the default straight line (bidirectional) tool. Click on the Timecard class, drag your mouse to the Person class and release the mouse. A new association will be created.
  6. Right-click on the Timecard end and uncheck Navigable. This will make the association one-way from Timecard to Person.
  7. Right-click on the Timecard end of the association and select Multiplicity -> 0..*. We'll leave the other end at the default multiplicity of 1.
  8. Double click just below the Person end of the association and type the name submitter. The Timecard end does not have to be named because it is not navigable. This completes the submitter association from Timecard to Person.
  9. Similarly add an approver association from Timecard to Person. Move the associations up or down as appropriate so they do not overlap each other.
  10. Make sure your class diagram matches the one shown above.
  11. Save the model by selecting File > Save Project.

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