Observer deseni, bire-çok bağımlılık tanımlayan ve birden fazla nesnenin (gözlemciler) başka bir nesne (konu) durumunu değiştirdiğinde otomatik olarak bildirildiği bir desendir. Soyutlanmış, olay odaklı iletişimi sağlar — UI'larda, olay sistemlerinde ve reaktif programlamada yaygın olarak kullanılır.
Observer deseninin yaptığı şey
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)
