This chapter reviewed the Observer pattern and its usefulness and implementation in a Web Service environment. The chapter started by looking at how the Java language implements the Observer pattern in its core class libraries through the java.util.Observer interface and the java.util.Observable class. It also discussed the increasing usage of the Observer pattern and derivations of it in the UDDI version 3 specification.
The Observer pattern implementation does not change much from the Java language implementation to a Web Service derivation of the pattern. In fact, many of the interfaces and sequences remain the same. The core difference between the object-oriented paradigm and the Web Service paradigm is in the pattern implementation. The Java language relies on a single-process Observer pattern implementation. The Web Services paradigm is inherently multiprocess , driving the need for both the Observer and Observable to be interfaces rather than having one or both be concrete implementations .
A major limitation of the pattern is its dependency on the client implementing a Web Service with the Observer interface. This dependency brings substantial bulk to the client, at least with Apache Axis as a Web Service host. (I address this limitation in later patterns, but for now it certainly appears to be a limiting factor in this pattern's usefulness.)