Behavioral Pattern

Category

Behavioral pattern identify common communication patterns between objects and describe how to implement them.

Patterns

Acyclic Visitor

Behavioral Pattern

The Acyclic Visitor pattern allows new functions to be added to existing class hierarchies without affecting those hierarchies, and without creating the dependency cycles that are inherent to the GoF Visitor pattern.

Chain of Responsibility

Behavioral Pattern

The chain of responsibility pattern is a design pattern that defines a linked list of handlers, each of which is able to process requests. When a request is submitted to the chain, it is passed to the first handler in the list that is able to process it.

Command

Behavioral Pattern

A command object encapsulates a request as an object. This object is sent to a receiver which executes the command. The advantage of this technique is that the requests can be queued, logged or implemented to support undo/redo.

Default Visitor

Behavioral Pattern

This pattern adds another level of inheritance to Visitor, providing a default implementation that takes advantage of the inheritance relationships in a polymorphic hierarchy of elements.

Extrinsic Visitor

Behavioral Pattern

Trade the performance overhead of a small number of run-time type tests for reduced complexity and coupling in the visitor and element classes by testing the feasibility of a visit operation before performing it.

Interpreter

Behavioral Pattern

The interpreter pattern is used to define the grammar for instructions that form part of a language or notation, whilst allowing the grammar to be easily extended.

Iterator

Behavioral Pattern

An iterator provides the interface to traverse a container's elements. The implementation is hidden so that the client does not need to understand the traversing algorithm.

Manager

Behavioral Pattern

The Manager design pattern encapsulates management of a class’ objects into a separate manager object. This allows variation of management functionality independent of the class and the manager’s reuse for different classes.

Mediator

Behavioral Pattern

The mediator pattern is used to reduce coupling between classes that communicate with each other. Instead of classes communicating directly, and thus requiring knowledge of their implementation, the classes send messages via a mediator object.

Memento

Behavioral Pattern

The memento pattern is used to capture the current state of an object and store it in such a manner that it can be restored at a later time without breaking the rules of encapsulation.

Null Object

Behavioral Pattern

Instead of using a null reference to convey absence of an object (for instance, a non-existent customer), one uses an object which implements the expected interface, but whose method body is empty. The advantage of this approach over a working default implementation is that a Null Object is very predictable and has no side effects: it does nothing.

Observer

Behavioral Pattern

The observer pattern is used to allow an object to publish changes to its state. Other objects subscribe to be immediately notified of any changes.

Sponsor-Selector

Behavioral Pattern

The Sponsor-Selector pattern can be used to provide a mechanism for selecting the best resource for a task from a set of resources that changes dynamically. It allows a software system to integrate new resources, and new knowledge about resources, at run-time in a way that is transparent to users of the resources. This pattern is based on the idea of separating three kinds of responsibilities: knowing when a resource is useful, selecting among resources, and using a resource.

State

Behavioral Pattern

The state pattern is used to alter the behaviour of an object as its internal state changes. The pattern allows the class for an object to apparently change at run-time.

Strategy

Behavioral Pattern

The strategy pattern is used to create an interchangeable family of algorithms from which the required process is chosen at run-time.

Template Method

Behavioral Pattern

The template method pattern is used to define the basic steps of an algorithm and allow the implementation of the individual steps to be changed.

Visitor

Behavioral Pattern

The visitor pattern is used to separate a relatively complex set of structured data classes from the functionality that may be performed upon the data that they hold.