Behavioral pattern
   HOME

TheInfoList



OR:

In
software engineering Software engineering is a branch of both computer science and engineering focused on designing, developing, testing, and maintaining Application software, software applications. It involves applying engineering design process, engineering principl ...
, behavioral design patterns are
design pattern A design pattern is the re-usable form of a solution to a design problem. The idea was introduced by the architect Christopher Alexander and has been adapted for various other disciplines, particularly software engineering. The " Gang of Four" ...
s that identify common communication patterns among objects. By doing so, these patterns increase flexibility in carrying out communication.


Design patterns

Examples of this type of design pattern include: ; Blackboard design pattern : Provides a computational framework for the design and implementation of systems that integrate large and diverse specialized modules, and implement complex, non-deterministic control strategies ; Chain-of-responsibility pattern : Command objects are handled or passed on to other objects by logic-containing processing objects ;
Command pattern In object-oriented programming, the command pattern is a Behavioral pattern, behavioral Design pattern (computer science), design pattern in which an object is used to Information hiding, encapsulate all information needed to perform an action or ...
: Command objects encapsulate an action and its parameters ;"Externalize the stack" : Turn a recursive function into an iterative function that uses a
stack Stack may refer to: Places * Stack Island, an island game reserve in Bass Strait, south-eastern Australia, in Tasmania’s Hunter Island Group * Blue Stack Mountains, in Co. Donegal, Ireland People * Stack (surname) (including a list of people ...
; Interpreter pattern : Implement a specialized computer language to rapidly solve a specific set of problems ; Iterator pattern :
Iterator In computer programming, an iterator is an object that progressively provides access to each item of a collection, in order. A collection may provide multiple iterators via its interface that provide items in different orders, such as forwards ...
s are used to access the elements of an aggregate object sequentially without exposing its underlying representation ;
Mediator pattern In software engineering, the mediator pattern defines an object that Encapsulation (computer programming), encapsulates how a set of objects interact. This pattern is considered to be a behavioral pattern due to the way it can alter the program's ...
: Provides a unified interface to a set of interfaces in a subsystem ; Memento pattern : Provides the ability to restore an object to its previous state (rollback) ; Null object pattern : Designed to act as a default value of an object
Observer pattern In software design and software engineering, the observer pattern is a software design pattern in which an object, called the ''subject'' (also known as ''event source'' or ''event stream''), maintains a list of its dependents, called observers (a ...
Defines a one-to-many dependency between objects so that when one object changes state, all its dependents are notified and updated automatically. The variant weak reference pattern decouples an observer from an observable to avoid memory leaks in environments without automatic weak references.
;
Protocol stack The protocol stack or network stack is an implementation of a computer networking protocol suite or protocol family. Some of these terms are used interchangeably but strictly speaking, the ''suite'' is the definition of the communication protoc ...
: Communications are handled by multiple layers, which form an encapsulation hierarchy ;
Publish–subscribe pattern In software architecture, the publish–subscribe pattern (pub/sub) is a messaging pattern in which message senders, called publishers, categorize messages into classes (or ''topics''), and send them without needing to know which components ...
A messaging pattern where senders (publishers) and receivers (subscribers) are decoupled via message topics and brokers. Commonly used in distributed systems, this pattern supports asynchronous, many-to-many communication.
; Scheduled-task pattern : A task is scheduled to be performed at a particular interval or clock time (used in
real-time computing Real-time computing (RTC) is the computer science term for Computer hardware, hardware and software systems subject to a "real-time constraint", for example from Event (synchronization primitive), event to Event (computing), system response. Rea ...
) ; Single-serving visitor pattern : Optimise the implementation of a visitor that is allocated, used only once, and then deleted ; Specification pattern : Recombinable
business logic In computer software, business logic or domain logic is the part of the program that encodes the real-world business rules that determine how data can be created, stored, and changed. It is contrasted with the remainder of the software that might ...
in a boolean fashion ;
State pattern The state pattern is a Behavioral pattern, behavioral software design pattern that allows an object to alter its behavior when its internal state changes. This pattern is close to the concept of finite-state machines. The state pattern can be inter ...
: A clean way for an object to partially change its type at runtime ; Strategy pattern : Algorithms can be selected on the fly, using composition ;
Template method pattern In object-oriented programming, the template method is one of the behavioral pattern, behavioral Software design pattern, design patterns identified by Gamma et al. in the book ''Design Patterns''. The template method is a method in a superclas ...
: Describes the
skeleton A skeleton is the structural frame that supports the body of most animals. There are several types of skeletons, including the exoskeleton, which is a rigid outer shell that holds up an organism's shape; the endoskeleton, a rigid internal fra ...
of a program; algorithms can be selected on the fly, using
inheritance Inheritance is the practice of receiving private property, titles, debts, entitlements, privileges, rights, and obligations upon the death of an individual. The rules of inheritance differ among societies and have changed over time. Offi ...
; Visitor pattern : A way to separate an algorithm from an object


See also

*
Concurrency pattern In software engineering, concurrency patterns are those types of design patterns that deal with the multi-threaded programming paradigm. Examples of this class of patterns include: * Active object * Balking pattern * Barrier * Double-check ...
*
Creational pattern In software engineering, creational design patterns are design patterns that deal with object creation Object may refer to: General meanings * Object (philosophy), a thing, being, or concept ** Object (abstract), an object which does not ex ...
* Structural pattern


References

{{Design Patterns patterns Software design patterns