observersubject
ObserverSubject is a design pattern that facilitates communication between objects. It establishes a one-to-many dependency between objects. When one object, known as the subject, changes its state, all objects that depend on it, called observers, are notified and updated automatically. This pattern promotes loose coupling, meaning the subject does not need to know the concrete classes of its observers. It only needs to know that they implement a specific observer interface.
The subject maintains a list of its observers. When a change occurs, it iterates through this list
Common use cases for the Observer pattern include graphical user interfaces, where UI elements (observers) need