Design Patterns Handbook
  • Introduction
  • Creational Patterns
    • Builder
    • Factory
    • Abstract Factory
    • Factory Method
    • Prototype
    • Singleton
    • Object Pool
    • Revealing Constructor
  • Structural Patterns
    • Adapter
    • Composite
    • Proxy
    • Flyweight
    • Facade
    • Bridge
    • Decorator
    • Private Class Data
  • Behavioral Patterns
    • Template Method
    • Mediator
    • Chain Of Responsibility
    • Observer
    • Strategy
    • Command
    • State
    • Visitor
    • Memento
    • Interpreter
    • Null Object
    • Iterator
    • Middleware
  • Clean Code Patterns
    • Extract Method
    • Clarify Responsibility
    • Remove Duplications
    • Keep Refactoring
    • Always Unit Test
    • Create Data Type
    • Comment to Better Name
    • Consistent Naming
    • If-else over ternary operator
    • Composition over Inheritance
    • Too Many Returns
    • Private to Interface
  • Anti Patterns
    • Big Ball of Mud
    • Singleton
    • Mad Scientist
    • Spaghetti Code
    • It Will Never Happen
    • Error Codes
    • Commented Code
    • Abbreviations
    • Prefixes
    • Over Patternized
    • Generic Interface over Function
Powered by GitBook
On this page

Was this helpful?

Behavioral Patterns

Behavioral patterns help to solve interaction or communication of objects.

Template method

  • Defer the exact steps of an algorithm to a subclass

Mediator

  • Defines simplified communication between classes

Chain of responsibility

  • A way of passing a request between a chain of objects

Observer

  • A way of notifying change to a number of classes

Strategy

  • Encapsulates an algorithm inside a class

Command

  • Encapsulate a command request as an object

State

  • Alter an object's behavior when its state changes

Visitor

  • Defines a new operation to a class without change

Memento

  • Capture and restore an object's internal state

Interpreter

  • A way to include language elements in a program

Null Object

  • Designed to act as a default value of an object

Iterator

  • Sequentially access the elements of a collection

PreviousPrivate Class DataNextTemplate Method

Last updated 5 years ago

Was this helpful?