I am using a session fascade pattern in our EJB implementation and am frustrated by the maintenance of all the interaces that this involves. The fascade accesses local entity objects, translates them into value objects and returns the value object interface. The value object interface is pretty much identical to the local interface except for the fact that the local interface inherits from EJBLocalObject and its accessor methods throw EJBExceptions.
My question is:
Would it be good practice to refactor this implementation so that instead of having
ValueObjectInterface {
getA();
setA();
getB();
setB();
}
and
LocalObjectInterface extends EJBLocalObject {
getA() throws EJBException;
setA() throws EJBException;
getB() throws EJBException;
setB() throws EJBException;
}
you would have
ValueObjectInterface {
getA() throws Exception;
setA() throws Exception;
getB() throws Exception;
setB() throws Exception;
}
and
LocalObjectInterface extends EJBLocalObject, ValueObjectInterface {
}
I would like to something simular with the fascade remote interface as well. This would allow client code to be oblivious to whether it was using an EJB bean or a JDBC implementation.
Tx for the help!
Chad Lavy