my dog learned polymorphism
The moose likes Developer Certification (SCJD/OCMJD) and the fly likes IOException Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login
JavaRanch » Java Forums » Certification » Developer Certification (SCJD/OCMJD)
Reply 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: 17225
    
    1

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
 
I agree. Here's the link: http://ej-technologies/jprofiler - if it wasn't for jprofiler, we would need to run our stuff on 16 servers instead of 3.
 
subject: IOException
 
Similar Threads
FBN: changing lock method's IOException
DatabaseException
IOException
Please review Server design
RecordNotFoundException and DuplicateKeyException