DSA Factory
Free Design patterns lessonsDesign patterns · Stage 2 · Behaviour and communication · Step 2

Observer

Letting many objects react to a change in another, without that object knowing who is listening. About 12 minutes.

Quick check

What does the subject need to know about each observer?

  1. AOnly that it implements the observer interface
  2. BIts concrete class
  3. CIts internal state
Show the answer

Only that it implements the observer interface. That keeps the coupling loose.

Lock it in

4 questions on this idea

Short questions that apply the idea to new cases: trace it, work out a number, put steps in order. A wrong answer explains itself.

Answer them in your browserFree account, no card. Your progress is saved, and the idea comes back in a quick review later.
Sign up free to solve