I don't see any design pattern that would achieve the behavior I am looking
for. The problem boils down to the rule in the spec that states each method
in an EJB remote interface must throw RemoteException.
This is a given. It has to be. There are design issues, however when I want
to reuse this interface. Suppose that I have an entity bean that manages a
collection of dependent objects. These objects are arranged in a hierarchy
whereby the values for one of the objects is calculated based on the values
of its children. Each of these objects expose the same interface (getName(),
getAmount(), etc.).
It would make sense to allow the client to access the entity bean by way of
a session bean that figured out which entity bean the clients object resided
in, and grabbed a reference to the entity. Any calls from the client would
be forwarded to the entity collection. The client should think he is talking
directly to the dependent object.
In order to pull this off, the session bean would have to extend the
interface of the dependent objects. No harm here, except the session bean's
remote interface must throw RemoteException on each business method. Uh oh,
since an interface can't override a method from another interface while
tacking on RemoteException, the original interface will have to be modified
to throw RemoteException.
This causes other issues. All of these dependent objects will then have to
be implemented to throw (or catch) RemoteExceptions that can't possibly
occur. They will always exist within the same process.
Any thoughts on how to skirt this issue?
jim
===========================================================================
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff EJB-INTEREST". For general help, send email to
[EMAIL PROTECTED] and include in the body of the message "help".