A simple example of the observer pattern in action