Sainmhíníonn an patrún Observer spleáchaintí duine-go-iomadúil ina bhfaigheann réada éagsúla (breathnóirí) fógra go huathoibríoch nuair a athraíonn réad eile (an ábhar) a staid. Cumasaíonn sé cumarsáid dhícheanglaithe, atá tiomáinte ag imeachtaí — úsáidtear go forleathan i UIanna, córais imeachtaí, agus ríomhchlárú imoibríoch.
Cad a dhéanann an 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)
