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
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Structure your ColdFusion code with Fusebox. Get the official book at
http://www.fusionauthority.com/bkinfo.cfm
Archives: http://www.mail-archive.com/[email protected]/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists