The Observer of the Food Bowl
Defining a one-to-many dependency so that when one object changes state, all its dependents are notified.
✧ GANG OF FOUR LINEAGE & ARCANUM ✧
GOF DESIGN PATTERN: Observer
ARCANUM SCHOOL: Divination // Event-Listening
SCRIBE / ARCHON: Joshua Edward McLaughlin Cox
CANONICAL REGISTRATION:
// CODEX INCANTATION //
HAI 1.2
CAN HAS STDIO?
HOW IZ I NOTIFY_CATS YR FOOD_LEVEL
VISIBLE "FOOD BOWL LEVEL: " FOOD_LEVEL
BOTH SAEM FOOD_LEVEL AN "FULL", O RLY?
YA RLY
VISIBLE "ALL CATS: MEOW! RUSHING TO BOWL!"
NO WAI
VISIBLE "ALL CATS: IGNORING."
OIC
IF U SAY SO
VISIBLE "FILLING BOWL..."
I IZ NOTIFY_CATS YR "FULL" MKAY
KTHXBYE
The Observer binds an array of spectral feline listeners to the legendary Food Bowl node. When the bowl signals a state change to FULL, an automated event storm awakens the slumbering swarm.
Runic Tags:
#observer
#feline
#cyber-runes