On 03-10-12 22:03, Greg Trasuk wrote:
I'm curious if anyone else has an opinion on something: Gregg recommends below that methods on remotely-accessible API should be declared to throw 'RemoteException'. I agree in principle, but a long time ago I convinced myself that 'RemoteException' was specific to the RMI technology, which is not actually required in Jini (The end of protocols, etc). If I had a service provide a smart proxy that talked to a machine using a serial port, was it still correct to have the API throw a RemoteException? It didn't seem right to me.
I disliked the RemoteException from the beginning. Everything went from having unchecked exceptions to checked exceptions. Nowadays i tend to code several wrappers. The original service (build without rmi stuff), a remotable wrapper, and at the other side a wrapper to deal with the remote svc. It is not simple, but i guess this is how jini evolved and the designers saw this as the pattern you always end up with anyway.
One good thing for RemoteException is, that it is a proper exception to be thrown when the underlying rpc fails. But in the API design it is a misfit. For me it always ends up wrapped in a runtimeexception or in the project there is no method without 'throws Exception'. but thats me i'm sure.
Gr. Simon
