To send the database exceptions to the client should I code this:
or should I add the DatabaseException to the signature of the methods in the stub remote implementation and interface. Thanks Charles.
Peter den Haan
posted 14 years ago
The second. A RemoteException is problem in the RMI transport mechanism. It is no coincidence that RemoteException is a subclass of IOException. A DatabaseException, on the other hand, has (usually) nothing to do with I/O, let alone RMI. In other words, DatabaseException IS-NOT-A RemoteException. Making it a subclass of RemoteException is therefore a venial sin against OOD hygiene, perhaps even a mortal one. - Peter