Is a BusinessRuleException a checked or unchecked exception?
Index Short answer: checked. Long answer: In the book we have BusinessRuleException as a checked exception, but the alternative is not entirely verboten. The rationale is that the typical Java rule for when to use RuntimeException is that you should do it only if the exception is unlikely in a properly configured and written system. For example, a NullPointerException should not happen because a user did not enter something; the programmer has the option to check for null or ensure that values are always initialized. Since business rule exceptions can and generally do happen based upon user interaction they do not fall under this category. For example, a user might try to have a farmer milk a cow that was milked too recently. On the other hand, some people like to make everything a RuntimeException. They feel this makes their code “cleaner” in that they do not require try/catch blocks and “throws” clauses in their code. The problem here is that someone needs to catch the exception so t