Author image

Observer Design Pattern


Observer is a behavioral software design pattern, that is being extensively utilized in almost every single self-respecting codebase as a means to efficiently communicate between objects in an event-based fashion. It wouldn't be an understatement to say it is the foundation of event based programming.

In fact, underlying the ubiquitous, in network programming, “Model View Controller” (MVC) design pattern, is the observer pattern.

Observers are used in every single game engine - they're known there mostly as “Event dispatchers”.

Alternative terminology for this pattern includes the following: - Publish-Subscribe, Listener-Reporter.

Design

  • a class, called the Subject, maintains a list of...

1