searchforsolutions

Just another WordPress.com site

Tip : Exception designing


  • Use checked exceptions for recoverable conditions and runtime exceptions for programming errors:Runtime exceptions should be used only to indicate programming errors, such as precondition violations.
  • Use exceptions only for exceptional conditions:That is, do not use exceptions for control flow.
  • Avoid unnecessary use of checked exceptions: In other words, don’t use checked exceptions for conditions from which the caller could not possibly recover, or for which the only foreseeable response would be for the program to exit.
  • Throw exceptions appropriate to the abstraction:In other words, exceptions thrown by a method should be defined at an abstraction level consistent with what the method does, not necessarily with the low-level details of how it is implemented.
Advertisements

2 responses to “Tip : Exception designing

  1. watch dogs trailer August 1, 2013 at 8:37 pm

    Wonderful article! This is the kind of info that should be shared around the internet.
    Disgrace on Google for not positioning this submit higher!
    Come on over and discuss with my website .
    Thank you =)

  2. the elder scrolls online beta August 2, 2013 at 11:53 pm

    It’s an amazing post in favor of all the online users; they will get advantage from it I am sure.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: