Module 23 Β· Design Patterns (All 23 GoF) β Lesson 19 of 23 Β· ~6 min
Observer
Observer: subscribers get notified on change
Problem: when one object changes, several others need to react β but the subject shouldn't hardcode who they are.
PawWalk scenario: a walk status flips to completed. Notify the owner, analytics, and push β each subscribed independently.
Ruby has require "observer"; include Observable, but a plain array of callbacks is often clearer: subscribe appends, notify calls each.