An example of the observer pattern