In the Pet store, for every entity bean they define, there is a value object
holder.  For example, there is an Order (the ejb) and the OrderModel.

What I have a problem with is the immense amount of code duplicity.  If my
Order object has 20 attributes, then I have to define the same 20 attributes
in OrderModel (along with all the accessors).

What I have done was to remove all the attributes from the OrderEJB and used
a class variable in OrderEJB of type OrderModel to hold all of its
attributes.  OrderModel is the only place where the attributes are defined.
OrderEJB uses a private instance of OrderModel to store it's state.  It's
getDetails() method (an ejb call) returns it's orderModel instance.

Why wasn't this done initially?

Phillip

===========================================================================
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff EJB-INTEREST".  For general help, send email to
[EMAIL PROTECTED] and include in the body of the message "help".

Reply via email to