On Mon, Mar 13, 2000 at 09:56:10AM -0500, Tom Preston wrote:
> Well, you can use a servlet session to store  any simple JavaBean
> that encapsulates the ProductIds of the user's shopping cart without
> using stateful session bean. You could even just keep every item in the
> cart directly in the servlet session as name value pairs if you want
> simple.
> 
> Laird Wrote:
> 
> Oliver Enseling wrote:
> > A good example for a stateful session bean is a shopping cart, IMHO.
> 
> I've always wondered about this example.  This means that for every
> concurrent user on your website, you have to have a stateful session
> bean active and keeping state.  If you have a really good day--say
> you're Amazon--then that's a lot of thrashing your appserver will get
> into, right?  Is this really the way to write a scalable application?
> 
> That said, on the other hand, the other choices don't look very good
> either.  You can do a stateless session bean in which case you're
> basically writing JDBC all day long, or you can do an entity bean, which
> 
> probably doesn't scale well either.
> 
> Does anyone have any comments on this?

In either way, you have to store the cart information some where on the
server-side (assuming no javascript tricking etc.). You are completely
free to choose wheter you implements the cart storage in the servlet sayer,
what means in the servlet engine, or in your application layer, what means
in an application-server (e.g. as a session beans). 

I guess an application server handle a high load of session beans much
better than a servlet engine.

My 2c.


-- 
Philipp Meier                              o-matic GmbH
Gesch�ftsf�hrer                 Marlene-Dietrich-Str. 5
Tel.: +49-(0)731-985 88-870             D-89231 Neu-Ulm

PGP signature

Reply via email to