Originally posted by lev grevnin:
This ClientData, when used in LOCAL mode will have to throw RemoteException for every method!!! That's stupid..
Why? It's merely an expression of the fact that your ClientData may encapsulate a Remote implementation. This is the same as complaining that java.io.BufferedReader.close() still throws IOException when it's used to wrap a CharArrayReader. Of course it does. It's an expression of the fact that BufferedReader can wrap any kind of Reader, including the ones that
can throw IOException in close(). If you just want a purely local implementation, you can use Data directly.
Of course i can do something like catching any exception thrown from the code of every method INSIDE the method, and then throwing an instance of a Runtime exception with appropriate message in it. This way nothing will have to be caught or declared.
But what's the point? You are just throwing away the benefit of checked exceptions and make exception handling more difficult. Not a good idea IMHO.
- Peter