O'Reilly logo

Web Technology: Theory and Practice by M. Srinivasan

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

7.7 A SHOPPING CART—SIMPLIFIED EXAMPLE

Consider a Bean shopping cart which lists out a set of beans (of the eating variety!) for the user to order items and store in a shopping cart. Though production-ready implementations of shopping cart handles complex scenarios, lets us abstract into a simple set of beans to demonstrate a local interface and how business logic is defined and applied.

 

X2BizLocal.java—The EJB business interface

 

Fig. 7.4 X2BizLocal.java—The EJB business interface

 

The business interface is listed out in the code shown in Figure 7.4. The interfaces are implemented in the Bean class.

 

 

Fig. 7.5 X2Biz.java—The EJB business interface logic

 

A few Java annotations ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required