Using a session facade to entity beans

We have seen how clients can access enterprise beans directly or by using access beans. We saw that using access beans simplifies the client code and accelerates its execution.

The trade-off of simplicity and speed is freedom. Using access beans limits the flexibility of the design and restricts the developer from using other techniques. In this section, we show how EJB client applications can use session beans instead.

Facade session beans

A common approach when designing EJB applications with entity and session beans is to use a facade in front of entity beans that protects the persistent data layer and controls all the client access. Such a facade can be built using a stateless session bean that provides: ...

Get EJB 2.0 Development with WebSphere Studio Application Developer 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.