Observe the Mode Observer
ArticleLink: http://lykke.iteye.com/blog/1309952
Two or more objects are expected. We call them subject and observer. When the status of one party changes,
The other party is notified. That is to say, as the observer side, it can monitor a specific state change of the subject,
And respond to it. A simple example is that when data in a user view is changed by a user, the backend database can be updated,
When the database is updated in other ways, the data display in the user view also changes.
The observer mode has nothing to do with depth. It uses Java inheritance and interfaces to set a state flag in the observer's abstract class,
This flag is used to determine whether to notify the observer object. While learning this model,
We should learn more about Java inheritance and flexible application of interfaces. In fact, all design patterns are inherited, interfaces, and multi-state flexible applications.