Session Beans Revisited

The case study for today has the same set of Session beans as yesterday, and their interfaces are the same. However, their implementation is quite different, because they delegate all database interactions to the Entity bean layer.

As an example, Listing 6.13 shows the original updateDetails() method in the stateful AdvertiseJob bean. The AdvertiseJob bean provides services for managing jobs.

Listing 6.13. AdvertiseJobBean.updateDetails() Without an Entity Bean Layer
 1: package agency; 2: 3: import java.util.*; 4: import javax.ejb.*; 5: import java.sql.*; 6: // imports omitted 7: 8: public class AdvertiseJobBean extends SessionBean 9: { 10: public void updateDetails(String description, String location, String[] skills) ...

Get Sams Teach Yourself J2EE™ in 21 Days now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.