Need appropriate pattern for shopping cart

hallo all,

as i've read in some articles there are common way to represent database entity (a row in the table) by an entyty beans.

but, what is an appropriate way to represent a set of rows ? for example - user's shopping cart.

i don't like the common way - to implement shopping cart as session bean and cart record as entity bean ... coz (imho) it is very slow - requires multiple database requests (ejbLoad calls) while loading cart content ... is there another pattern ?

[511 byte] By [mkskorik] at [2007-9-26 16:10:27]
# 1

represent the cart as a session bean and the line items as a dependent object. Create a class class LineItems that implements java.io.Serializable. You avoid the cost of a remote call. As the line items are not available without the Cart bean there is no need for the user to access the line items directly without going through the Cart bean. So the line item class does not need to be a EJB.

wgower at 2007-7-2 19:31:54 > top of Java-index,Other Topics,Patterns & OO Design...