This tutorial introduces session beans, through the development of a stateful session bean. These beans serve one client only.
Session beans are the containers of the application code that will drive your application. Unlike entity beans, session beans are flexible enough to offer the user a range of different functions. It is important to understand that session beans are instantiated to serve one and only one user at a time. If the session bean is stateful, as in this tutorial, the bean instance will remain with the same user throughout it's life. This means you can store user-supplied data with the bean and refer to it on future method invocations. Stateless session beans will be covered elsewhere.
When you design an application in EJB, think of what the classes of interraction with the server will be. For example, the system may be required to service customers, employees, managers and administrators. Each class of user will require a different interface, and therefore a different session bean. In this tutorial we concentrate on a session bean intended for use by a shopping customer. However, such a system could be extended to give a manager a way of discovering information about customer buying habits. Rather than building each class of user a different system, think about flexibility early on.
Last Modified: Tuesday, 20-Oct-1998 23:45:27 GMT
/tutorials/cart/home.htm
copyright (c) ejbhome ltd. all rights reserved.