THE ATHENA LIBRARY
Design Patterns Field Guide
Noah Bekele field guide
Pattern 5
Observer
An Observer subscribes to a subject and is notified when its state changes. The subject knows only the Observer interface, never the concrete listeners.
Graphical interfaces, spreadsheets and event systems all rely on this decoupling.
Watch for memory leaks: observers that are never unsubscribed keep objects alive longer than intended.
Fictional educational sample written for the Athena demo · Page 58 of 184.
100%saved