Here’s an idea about exceptions that I hadn’t seen before: catch them as early as possible, and then

To avoid strong coupling between parts of the system we shouldn’t inform the caller that we had a problem. Instead, the object that catches the exception should set its own state such that it will answer future messages in the light of the problem that occurred. (In particular, the NullObject or SpecialCase pattern is useful here.)

I actually like exceptions just fine, but it would be interesting to think about how this suggestion might work out in practice.

Post Revisions:

There are no revisions for this post.