MΓ³dulo 23 Β· Design Patterns (All 23 GoF) β LecciΓ³n 19 de 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.