Skip to content

Files

Latest commit

43e5eae · May 31, 2024

History

History

Observer

Observer Pattern

Behavioral Type

Use cases:

this pattern is used when we want to notify the changes of internal state of a class to other registered class

Classes

  • Publisher - class that have state that when its change other concreteobserver class will notify
  • ConcreteSubscriber - classes that registered in Publisher and will notify the changes of its state
  • ConcreteState - class that take action on request diffrently from another concretestate class

Interfaces

  • Subscriber - contains update method

Visual Diagram

Visual Diagram Observer Pattern image by refactoring guru