Invisible Exception Handlers

An alternative to throwing exceptions, possibly an AntiPattern.

The idea is to just bury the code to handle exceptional cases in the object that does the normal action. This is much simpler than using exceptions or some other mechanism, but very difficult to test, breaks the OneResponsibilityRule, is low on communication, and so on.

ExceptionHandlingChallenge entry:

 mailPassword(email, password);
(That is, when an exception occurs, you have the UserDatabase.add() and mailPassword() methods themselves do the database-recovery and redirection.)

Pros: Cons:

View edit of January 12, 2013 or FindPage with title or text search