dcsimg
 

Observer Pattern Class

by Ray Virzi

The class CObserver is a base class from which you can derive both observer and subject classes. An 'observer' object is one whose internal state depends upon the internal state of one or more other objects.

The objects that it depends on are referred to as 'subjects'. The class interface is very simple, having only a few inline functions, one of which is virtual and can be overridden to implement the update function. In spite of its s

This article was originally published on Thursday May 4th 2000
Home
Mobile Site | Full Site