Use cases
We generally use the observer pattern when we want to inform/update one or more objects (observers/subscribers) about a change that happened on a given object (subject/publisher/observable). The number of observers, as well as who those observers are, may vary and can be changed dynamically.
We can think of many cases where the observer pattern can be useful. One such use case is newsfeeds. With RSS, Atom, or other related formats, you follow a feed, and every time it is updated, you receive a notification about the update.
The same concept exists in social networking. If you are connected to another person using a social networking service, and your connection updates something, you are notified about it. It doesn't matter if the connection is a Twitter user that you follow, a real friend on Facebook, or a business colleague on LinkedIn.
Event-driven systems is another example where the observer pattern is usually used. In such systems, you have listeners that...