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 ...