aspose file tools*
The moose likes Developer Certification (SCJD/OCMJD) and the fly likes IOException Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Certification » Developer Certification (SCJD/OCMJD)
Bookmark "IOException" Watch "IOException" New topic
Author

IOException

Steve Harper
Greenhorn

Joined: May 09, 2002
Posts: 3
Would it make sense to modify the DatabaseException so that it extended IOException. That way you could declare the DataInterface methods so that they only threw IOException instead of both RemoteException and DatabaseException.
The reason I say this is at the moment the client has to have code to deal with RemoteExceptions even when running in local mode when they would never be thrown.
John Smith
Ranch Hand

Joined: Oct 08, 2001
Posts: 2937

The reason I say this is at the moment the client has to have code to deal with RemoteExceptions even when running in local mode when they would never be thrown.

Your client may throw a subset of exceptions in the interface.
Eugene.
Mark Spritzler
ranger
Sheriff

Joined: Feb 05, 2001
Posts: 17259
    
    6

And in the remote implemetation of your interface, you can wrap these RemoteExceptions into a DataBaseException and throw that instead so that your client only needs to catch DataBaseExceptions.
Mark


Perfect World Programming, LLC - Two Laptop Bag - Tube Organizer
How to Ask Questions the Smart Way FAQ
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: IOException