The observer pattern is useful for state monitoring and event handling situations. This pattern allows a given object to be monitored by an unknown and dynamic group of observer objects.
Whenever a value on the core object changes, it lets all the observer objects know that a change has occurred, by calling an update() method. Each observer may be responsible for different tasks whenever the core object changes; the core object doesn't know or care what those tasks are, and the observers don't typically know or care what other observers are doing.
Here it is in UML:
![](https://static.packt-cdn.com/products/9781789615852/graphics/assets/ba0eb0db-e28f-48b0-900a-a501cb8938e0.png)