The observer method is a Behavioral design Pattern which allows you to define or create a subscription mechanism to send the notification to the multiple objects about any new event that happens to the object that they are observing . The subject is basically observed by multiple objects.
Read moreWhat is the purpose of using an observer?
The responsibility of observers is to register (and unregister) themselves on a subject (to get notified of state changes) and to update their state (synchronize their state with the subject’s state) when they are notified.
Read more