Java Reference
In-Depth Information
Forces
• Consolidate business methods in a common interface.
• Enforce compile-time checks to prevent anomalies between the remote interface
and the bean implementation.
• Prevent EJB bean implementation classes from implementing remote or local
interfaces.
Solution
Implement a business interface to consolidate business methods and apply compile-time
checks of EJB methods.
Strategies with the Spring Framework
A business interface is a plain Java interface that consolidates the methods that the bean
class will implement. The local and remote interfaces also extend the business interface.
Thus, this superinterface keeps the method signature and count in sync and allows any
differences to be detected at compile time. Further, since the business interface does not
extend EJBObject or EJBLocalObject , the bean class is saved from unnecessary method
implementation. I will now show how to put the business interface into action for differ-
ent types and versions of stateless session beans.
Figure 4-4 shows the class diagram of the business interface for a remote SLSB.
 
Search WWH ::




Custom Search