El patrón Observer define una dependencia uno-a-muchos donde múltiples objetos (observadores) son notificados automáticamente cuando otro objeto (el sujeto) cambia de estado. Permite comunicación desacoplada y dirigida por eventos — ampliamente utilizada en UIs, sistemas de eventos y programación reactiva.
Qué hace el patrón Observer
OBSERVER → a SUBJECT maintains a list of OBSERVERS and NOTIFIES them on state changes:
→ observers SUBSCRIBE to the subject
→ when the subject changes → it notifies ALL subscribed observers automatically
→ observers react to the notification (update themselves)
→ one-to-many: one subject, many observers; DECOUPLED (subject doesn't know observer details)
