Observer Pattern defines a one-to-many dependency between objects so that when one object changes state, all its dependencies are notified and updated automatically.
-
Identify the aspects of your application that vary and separate them from what stays the same
-
Program to an interface, not an implementation.
-
Favor composition over inheritance.
-
Strive for loosely coupled designs between objects that interact.