Create UserService

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

UserService

Containment Tree

We will create UserService in a package named org.andromda.timetracker.service. When finished, the containment tree in ArgoUML will look like the screen shot on the right.

  1. In the TimeTracker model create a package called service under org.andromda.timetracker.
  2. In the Containment Tree on the left, right-click on the service package and select Create DiagramNew Class Diagram. Select the new unnamed diagram and type in Services as its name on the property panel. The diagram is created and opened in a new window.
  3. Add a new class to the diagram and name it UserService.
  4. Add the stereotype called Service to UserService.
  5. Let's add the getAllUsers() method to UserService. Double-click on the operations compartment (the bottom one) of the UserService class to create a new operation. A new operation is inserted with the specification "+newOperation() : void". Write over this specification with this new one: "+getAllUsers() : Collection<UserVO>".
  6. Similar to creating new attributes, you can also create new operations from the property panel if that fits your work style better. Click on the New Attribute Tool New Attribute Tool and fill in the name, visibility, and return type on the Operation property panel for the newly created operation. The property panel provides more explicit guidance, but typing a specification on the diagram tends to be faster for experienced users.
  7. Make sure your class diagram matches the one shown above.
  8. Make sure that the ArgoUML explorer pane matches the screen shot shown above.
  9. Save the model by selecting FileSave Project (or just type keyboard accelerator Ctrl/S).

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