david mcdonald wrote:
> In the Oreilly Enterprise Javabeans book, in the design strategies chapter ,
> it recommends not chaining stateful session beans. (p. 283)
> In the Sun APM (p.83) the Stateful session bean EStorekeeper calls the
> Shopping cart stateful session bean.
> Is this a good design strategy or not?
The reason for not doing this is that stateful session beans are not "reliable"
across a system failure, and are subject to timeouts. Thus EStorekeeper will
need code to cope with the error situation that its instance of ShoppingCart has
disappeared. Although there may be a simple strategy for EStorekeeper in this
case (it could simply disappear too) the problem is compounded when there are
more than two beans involved.
> Also the APM uses event driven state machines in the controller JSP and the
> controller Stateful session bean EStoreKeeper. Is this a good design strategy?
Event-driven state machines are generally a good design approach. But linking
multiple state machines is usually very difficult and certainly does not usually
result in reusable components. So I'd say no, it isn't a good design strategy.
Ian McCallion
===========================================================================
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".