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 ... more.

I cant really gove you an answer,but what I can give you is a way to a solution, that is you have to find the anglde that you relate to or peaks your interest. A good paper is one that people get drawn into because it reaches them ln some way.As for me WW11 to me, I think of the holocaust and the effect it had on the survivors, their families and those who stood by and did nothing until it was too late.

Related Questions