0% found this document useful (0 votes)
11 views2 pages

Design Patterns Cheatsheet

The document provides a cheat sheet for design patterns categorized into three types: Creational, Structural, and Behavioral. Each category lists specific patterns along with their key characteristics and use cases. Additionally, a visual map illustrates the relationship between these categories and their respective patterns.
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
11 views2 pages

Design Patterns Cheatsheet

The document provides a cheat sheet for design patterns categorized into three types: Creational, Structural, and Behavioral. Each category lists specific patterns along with their key characteristics and use cases. Additionally, a visual map illustrates the relationship between these categories and their respective patterns.
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd

Design Patterns Cheat Sheet & Visual Map

1️⃣Cheat Sheet
Creational Patterns
 Singleton: “Only one instance exists.” Use for shared resources.
 Factory Method: “Delegate object creation.” Use when client should
not know subclass.
 Abstract Factory: “Factory of factories.” Use for related families of
objects.
 Builder: “Step-by-step construction.” Use for complex objects.
 Prototype: “Clone existing object.” Use for costly object creation.

Structural Patterns
 Adapter: “Convert interface to expected one.” Integrate legacy code.
 Bridge: “Separate abstraction from implementation.” Vary
independently.
 Composite: “Treat group and individual uniformly.” Use for tree
structures.
 Decorator: “Add behavior dynamically.” Extend functionality.
 Facade: “Simplify complex subsystem.” Unified entry point.
 Flyweight: “Share common state.” Reduce memory usage.
 Proxy: “Control access to object.” Lazy load, logging, security.

Behavioral Patterns
 Chain of Responsibility: “Pass request along chain.” Multiple handlers.
 Command: “Encapsulate request as object.” Queue, log, undo.
 Interpreter: “Represent grammar rules as classes.” Parse expressions.
 Iterator: “Access elements without exposing structure.” Traverse
collections.
 Mediator: “Central hub for communication.” Reduce coupling.
 Memento: “Capture and restore state.” Undo/redo.
 Observer: “One-to-many notification.” State change triggers reactions.
 State: “Behavior changes with internal state.” Change behavior
dynamically.
 Strategy: “Choose algorithm at runtime.” Select algorithms
dynamically.
 Template Method: “Skeleton algorithm with customizable steps.”
Reuse structure.
 Visitor: “Add operations without changing object structure.” Separate
operations.

2️⃣Visual Map
Creational Patterns –> Structural Patterns –> Behavioral Patterns
Creational Patterns: - Singleton - Factory Method - Abstract Factory - Builder -
Prototype
Structural Patterns: - Adapter - Bridge - Composite - Decorator - Facade -
Flyweight - Proxy
Behavioral Patterns: - Chain of Responsibility - Command - Interpreter -
Iterator - Mediator - Memento - Observer - State - Strategy - Template
Method - Visitor

You might also like