Observer

The Observer pattern is a behavioral design pattern that allows an object (called the subject) to notify other objects (called observers) when the subject's state changes.

The Observer pattern is particularly useful when you need to notify multiple objects about changes in another object. It allows you to define a one-to-many dependency between objects so that when one object changes state, all its dependents are notified and updated automatically.