Skip to content

Latest commit

 

History

History
19 lines (13 loc) · 652 Bytes

File metadata and controls

19 lines (13 loc) · 652 Bytes

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