I have a rule that says that my password must be more that 4 characters. So in my User domain object I have to check this in the setPassword method.
If the rule is broken I throw an exception. I can't decide wether I throw a checked or unchecked exception in this case. Can somebody advise me ?
It's an exception the caller can handle so Rod's book advise to throw a checked exception. But if I do that, lot of my setters will throw exception and this may lead in a lot of unnecessary catch blocks.