Behavioral Patterns

Behavioral design patterns are concerned with algorithms and the assignment of responsibilities between objects. They describe not just patterns of objects or classes but also the patterns of communication between them.

Patterns in This Category

  1. Chain of Responsibility — Avoid coupling the sender of a request to its receiver by giving more than one object a chance to handle the request
  2. Command — Encapsulate a request as an object, thereby letting you parameterize clients with different requests
  3. Iterator — Provide a way to access the elements of an aggregate object sequentially without exposing its underlying representation
  4. Mediator — Define an object that encapsulates how a set of objects interact
  5. Memento — Without violating encapsulation, capture and externalize an object’s internal state so that the object can be restored to this state later
  6. Observer — Define a one-to-many dependency between objects so that when one object changes state, all its dependents are notified and updated automatically
  7. State — Allow an object to alter its behavior when its internal state changes
  8. Strategy — Define a family of algorithms, encapsulate each one, and make them interchangeable
  9. Template Method — Define the skeleton of an algorithm in an operation, deferring some steps to subclasses
  10. Visitor — Represent an operation to be performed on the elements of an object structure

Table of contents


Back to top

Design Patterns Guide — content is provided for educational purposes.

This site uses Just the Docs, a documentation theme for Jekyll.