A simple example using the observer pattern