We will now add a value object called TimecardVO to the model. This will be the value object for the Timecard entity and we will keep it simple by mapping it one-to-one with the Timecard entity. The model for the TimecardVO looks like this:
The TimeTracker front end will receive TimecardVO objects from the time tracking service. Typically items that the front end will need to display are put in value objects. For example we could add a string with the submitting user's name toTimecardVO, even though this information may or may not be stored in the actual Timecard entity.
in the toolbar and make a new class on the surface. Double click on the class, name
itTimecardVO, and add the
Value Object
stereotype
to it.
and draw a dependency from the
Timecard
class to the
TimecardVO
class. Adding this dependency will tell AndroMDA that the
Timecard
entity will be converted to
TimecardVO
objects, and it will generate
helper code in the generated
TimecardDao
data access class to support
translation between them.
in the toolbar and make a new class on the surface. Double click on the class and
name itTimecardVO[]. We do not need to add a stereotype to it.
This will create a type that we can use to return collections of
TimecardVO
objects from service methods.