• Dear Guest, Please do NOT forget to join our JAVA JOBS (ONLY) FACEBOOK GROUP to be aware of latest JAVA openings, and you may also post any JAVA related queries/jobs.

What is an Observer Pattern ?

The Observer Pattern Define a one-to-many dependency between objects so that when one object changes state, all its dependents are notified and updated automatically. It also known as Dependents, Publish-Subscribe, Model-View.

Use the Observer Pattern in any of the following situations :

- When an abstraction has two aspects, one dependent on the other. Encapsulating these aspects in separate objects lets you vary and reuse them independently.

- When a change to one object requires changing others.

- When an object should be able to notify other objects without making assumptions about those objects.