Observer:
defines a one-to-many dependency between objects so that when one object changes state, all its dependents are notified and updated automatically.
Principles:
Strive for loosely coupled designs between objects that interact. (Observer pattern)
Class diagram:
Java's built-in Observer Pattern
abstract class:
java.util.observerable
(1)must be extended
(2)must call setChaged() before notifyObservers()
interface:
java.util.observer
=============================================================
class:
android.database.Observable<T> | ||
↳ | android.database.ContentObservable |
android.database.ContentObserver
=============================================================
abstract class:
android.content.ContentProvider
android.content.ContentResolver
android.database.ContentObserver
ContentProvider-->ContentResolver-->ContentObserver