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.
What does the subject need to know about each observer?
- AOnly that it implements the observer interface
- BIts concrete class
- CIts internal state
Show the answer
Only that it implements the observer interface. That keeps the coupling loose.
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