Do you not define the fine grain accessors on the entity bean since they are
on the value object? Meaning a remote client should be calling the
getDetails() method, but what about a session bean which might be in the
same JVM. Does it also need to fetch the details object and then get the
attribute out of it, or can it call a fine grain accessor on the entity
bean?
Cheers
Jay Walters
NetNumina Solutions
-----Original Message-----
From: Rhodes, Phillip C. [mailto:[EMAIL PROTECTED]]
Sent: Friday, January 05, 2001 12:15 PM
To: [EMAIL PROTECTED]
Subject: Value-holder design methodology flaw
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".
===========================================================================
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".