Design Patterns

23 topics

Singleton Pattern: Ensure One Instance

Ensure only one instance exists

Factory Method Pattern: Creational Design Guide

Define interface for creating objects

Abstract Factory Pattern: Guide & Examples

Create families of related objects

Builder Pattern: Creational Design Guide

Construct complex objects step by step

Prototype Pattern: Clone Objects Efficiently

Clone existing objects

Adapter Pattern: Structural Design Guide

Convert interface of one class to another

Bridge Pattern: Decouple Abstraction from Implementation

Separate abstraction from implementation

Composite Pattern: Tree Structure Design Guide

Compose objects into tree structures

Decorator Pattern: Add Behavior Dynamically

Add responsibilities dynamically

Facade Pattern: Simplify Complex Subsystems

Simplified interface to complex subsystem

Flyweight Pattern: Memory Optimization Design

Share common state between objects

Proxy Pattern: Control Object Access in OOP

Placeholder for another object

Iterator Pattern: Traverse Collections in OOP

Sequential access to elements

Observer Pattern: Event-Driven Design Guide

Notify dependents of state changes

Strategy Pattern: Swap Algorithms at Runtime

Define family of interchangeable algorithms

Command Pattern: Behavioral Design Guide

Encapsulate request as object

State Pattern: Manage Object State Transitions

Object behavior changes with state

Template Method Pattern: Define Algorithm Skeleton

Define algorithm skeleton, defer steps

Visitor Pattern: Add Operations Without Changing Classes

Add operations to object structure

Mediator Pattern: Reduce Object Coupling

Centralize complex communications

Memento Pattern: Undo/Redo State Management

Capture and restore object state

Chain of Responsibility Pattern Explained

Pass request along chain of handlers

Interpreter Pattern: Parse Grammars in OOP

Define a grammar and interpret sentences in the language - DSLs, expression parsers, rule engines