• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

[Bodgit Scrapper] Thought regarding the DB interface and exceptions

 
Robert Konigsberg
Ranch Hand
Posts: 172
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello all,

What's the problem if the new exceptions in the DB interface all derive from RuntimeException? Is this a terrible thought?

Thanks, Rob
 
Eben Hewitt
Author
Ranch Hand
Posts: 36
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
If you extend RuntimeException you don't have to declare them in the method definition. That's not a problem per se, but in my view it makes your code a little less clear.

RuntimeException extends exception, and RemoteException extends IOException, so that might be interesting to note for your design if you are using a Proxy.
 
Robert Konigsberg
Ranch Hand
Posts: 172
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
More problematic actually is that there's an exception called SecurityException which is extended from RuntimeException and I do not have the benefit of an angry compiler telling me where I need to catch it!

I may have to create a SecurityException class as well, and derive it from Exception. You know? Does anyone think this is illegal? I do not see it as so.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic