The Observer Pattern is the foundation of the Model View Controller (MVC) pattern, in which a view is updated automatically whenever the model’s state changes . … The subject interface defines a contract for attaching and detaching an observer to the subject, as well as notification of changes to any attached observers.