Behavioral Patterns

Algorithms and the assignment of responsibilities between objects.

Table of Contents

  • Chain of Responsibility: Lets you pass requests along a chain of handlers.
  • Command: Turns a request into a stand-alone object that contains all information about the request.
  • Interpreter: Given a language, define a representation for its grammar along with an interpreter that uses the representation to interpret sentences in the language.
  • Iterator: Lets you traverse elements of a collection without exposing its underlying representation.
  • Mediator: Lets you reduce chaotic dependencies between objects.
  • Memento: Lets you save and restore the previous state of an object without revealing the details of its implementation.
  • Observer: Lets you define a subscription mechanism to notify multiple objects about any events that happen to the object they’re observing.
  • State: Lets an object alter its behavior when its internal state changes.
  • Strategy: Lets you define a family of algorithms, put each of them into a separate class, and make their objects interchangeable.
  • Template Method: Defines the skeleton of an algorithm in the superclass but lets subclasses override specific steps of the algorithm without changing its structure.
  • Visitor: Lets you separate algorithms from the objects on which they operate.