Day 6. Developing Stateful Session Beans

Today you'll learn how to develop applications that maintain the conversational state on behalf of the client. You'll work on a complete example of developing a stateful session bean.

The sample university registration application enables students to browse the online course catalog. While browsing the catalog, the student can select the course(s) she likes and place them in a temporary enrollment cart. The student can view or delete courses from the cart, and may later decide to place an order for the cart contents.

EnrollmentCart represents a collection of courses selected by a student in a particular session. The cart should not be shared, because it represents a particular interaction with a particular student and is alive only for the student's session. Also, the cart is not saved into the database unless the student is ready to place an order. The cart becomes a persistent order when the student decides to purchase it. A cart must be allocated by the system for each student concurrently connected to the Web site. All these characteristics make EnrollmentCart an ideal candidate for a stateful session bean. You will undertake each of the following:

  • Examine the interactions between the client, EJB container, and the stateful session bean by looking under the hood of the bean

  • Define the home and component interfaces for the stateful session bean

  • Implement the stateful session bean class

  • Learn how to write the deployment descriptors, and package and deploy the enterprise bean

  • Write a sample client that accesses the stateful session bean

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
52.15.214.27