We now have the the entities and value objects modeled and we need to add services that will operate on these objects. Here we will create theTimeTrackingService. For this tutorial we will create one method on the service called GetAllTimecards method which will return all the timecards in the system. The model for the TimeTrackingService looks like this:
in the toolbar and make a new class on the surface. Double click on the class, name
itTimeTrackingService, and add the
Service
stereotype
to it.
Note: Sometimes if you type TimecardVO[] on the diagram surface, MagicDraw will set the type to TimecardVO with a return type modifier of[]. This is incorrect, as you want the return type to be TimecardVO[] with no return type modifier set. This can be changed by double clicking on the method name and using the Operation Specification dialog.
and draw a dependency from the
TimeTrackingService
class to the
Timecard
class. Adding this dependency tells AndroMDA to make it
easy to access the timecard data access class from methods inside in the
TimeTrackingService
class.
tool.