Best Practices

In this section, we look at some best practices you can adopt in your bean development to make it more robust.

Default Session Bean Class

While discussing Stateless Session Beans, we said that your bean implementation has to define the ejbActivate and ejbPassivate methods, in spite of the fact that Stateless Session Beans are never activated or passivated. This arises from the fact that the interface that Session Beans implement is common for both Stateless and Stateful Session Beans. Obviously, this isn't very clean.

Along the same lines, imagine a case of both Stateful and Stateless Session Beans in which the bean implementation has to define all those callback methods. If your bean implementation doesn't need several of those ...

Get BEA WebLogic Server™ 8.1 Unleashed 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.