Skip to content

Latest commit

 

History

History
20 lines (15 loc) · 745 Bytes

README.md

File metadata and controls

20 lines (15 loc) · 745 Bytes

Observer Pattern

Type

The Observer Design Pattern is a behavioral pattern.

Description

The observer design pattern gives you the ability to trigger an operation in a class (the observer) when the observable class changes its state.

Use

  1. When a class needs to know when a another object its state changes.

Prevent

  1. From the need to implement a polling system (every x minutes, check for changes in object y).

Simple Structure

alt text

Advanced Structure

alt text

References

  1. https://refactoring.guru/design-patterns/observer