Observers And Exceptions

In the recent discussions about exceptions, problems with the Observer Pattern have come to light.

An Observable is responsible for notifying its observers whenever relevant state changes occur. Since exceptions are, in essence, violations of the standard control flow, they present problems in for such radically uncoupled objects.

There are two major consequences:

methods on the Observable object should not throw exceptions unless they Tidy Up Before Throwing

Either Observers Should Never Throw Exceptions or ObservablesShouldUseATwoPhaseCommit


How about Exception Reporter technique?


See original on c2.com