|
Guidelines, Patterns, and code for end-to-end Java applications.Questions and Answers - Session state in the EJB tier1. How can state be maintained in the EJB tier, and what are the tradeoffs involved?
A session is a sequence of service requests by a single user using a single client to access a server. The information maintained in the session across requests is called session state. Session state may include both information visible to the user (shopping cart contents, for example) and invisible application control information (such as user preferences).
ShoppingClientControllerEJB,
CustomerEJB, and
AdminClientControllerEJB).
These stateful session beans act as facades, managing access
to finer-grained enterprise beans and handling the details of accessing
these beans based on user identity (enterprise beans
CustomerEJB,
ProfileMgrEJB,
ShoppingCartEJB,
AccountEJB,
OrderEJB). The
Session Entity Facade design pattern explains this design in more detail.
Some applications do not need the power or overhead of enterprise beans. In
these situations, we recommend
storing client session state in the
web tier, using the
HttpSession interface implemented for your server.
| |||||
|
| ||||||||||||