posted 24 years ago
Hello,
If you use a DataClient inteface that defines all the public
methods, then have LocalDataClient and RemoteDataClient implement that interface, then your LocalDataClient doesn't have to throw RemoteException. I may be wrong here, but it seems like I read somewhere that you have tried this approach, but perhaps you had the interface throwing remoteexceptions. I THINK the key is to have the interface throwing Exception. That way the localdataclient can throw whatever exceptions it likes and the remotedata client can throw whatever exceptions it like (in particular remoteexception). I think maybe you might have had a problem if you tried to have the interface throw a remoteexception. If I'm not mistaken an implementing class must throw no exceptions, the same exceptions of children of the exceptions thrown in the interface. Therefore, if you defined your interface to throw RemoteException, you'd have to throw it in both classes that implement that interface whereas if you define it to throw Exception, you're golden. That's the way I did it anyway. Hope that helps.
With Respect,
Matt