What is the observer pattern?
As mentioned in the introduction the observer pattern allows us to implement a one-to-many relationship in a loosely coupled fashion. Loosely coupled means that the objects don’t know much about each other, they know just enough to get the job done. To illustrate the observer pattern imagine you want to subscribe to Time magazine. You go to the Time magazine website, fill out a few forms and now you are subscribed for a time period of your choosing. In this scenario we will say that Time magazine is the subject, and you, along with all other subscribers are the observers. When a new issue of Time magazine comes out you will be notified via the physical receipt of the latest issue. If we cast our minds back to a time before we were subscribers of the magazine we will remember that when a new issue came out we didn’t receive a copy, and we probably weren’t even told about the availability of a new issue. In the preceding example scenario we identified that Time magazine was the subject,