January 22, 2017

[HDGEM] Eight guidelines of exception handling In Java

In Joshua Bloch's book, Effective Java, he described these eight guidelines of exception handling:
  1. Use exceptions only for exceptional scenarios.
  2. Use checked exceptions for recoverable conditions and runtime exceptions for programming errors.
  3. Avoid unnecessary use of checked exceptions.
  4. Favor the use of standard exceptions.
  5. Throw exceptions appropriate to the abstraction.
  6. Document all exceptions thrown by each method.
  7. Include failure-capture information in detail messages.
  8. Don't ignore exceptions.


--
Posted By Blogger to HDGEM at 1/22/2017 02:39:00 AM
Post a Comment

Featured Post

The new Dell XPS 13’s overall design is 30% thinner and lighter than its predecessor

The new Dell XPS 13 has twice the performance of the XPS 13 launched in 2015, as well as improved battery life that should enable the model...