Behavioral
14 items tagged with "behavioral"
Patterns14
Strategy
Defines a family of interchangeable algorithms behind a common interface so the algorithm can vary independently from the clients that use it.
Observer
Establishes a one-to-many dependency so that when one object changes state, all its dependents are notified and updated automatically.
Command
Encapsulates a request as an object, letting you parameterize, queue, log, and undo operations independently of who invokes them.
Iterator
Provides a uniform way to traverse the elements of a collection sequentially without exposing its underlying representation.
Mediator
Centralizes complex communication between objects in a mediator so components refer to it instead of to each other, reducing coupling.
Memento
Captures and externalizes an object's internal state so it can be restored later without violating encapsulation.
State
Lets an object alter its behavior when its internal state changes, appearing to change class by delegating to state-specific objects.
Template Method
Defines the skeleton of an algorithm in a base method, deferring specific steps to subclasses so they can vary parts without changing the structure.
Visitor
Separates an algorithm from the object structure it operates on, letting you add new operations over a class hierarchy without modifying it.
Chain of Responsibility
Passes a request along a chain of handlers, each deciding to process it or forward it, decoupling sender from the specific receiver.
Interpreter
Defines a grammar for a simple language and an interpreter that evaluates sentences in that language using a class per grammar rule.
Null Object
Provides a do-nothing object with neutral behavior in place of null, eliminating null checks and special-case handling.
Specification
Encapsulates a business rule as a reusable, combinable predicate object that tells whether a candidate satisfies the rule.
Servant
Defines shared behavior for a group of classes in a separate servant object that operates on them, instead of duplicating the behavior in each class.