Structural Design Patterns

Updated Nov 23, 2025

Structural Design Patterns

Structural design patterns deal with the composition of classes and objects to form larger, flexible, and efficient structures.


List of Main Structural Design Patterns

  1. Adapter Pattern
    Allows incompatible interfaces to work together.

    • Example: Adapting a legacy class to a new interface.
  2. Decorator Pattern
    Adds behavior or responsibilities to individual objects dynamically.

    • Example: Adding scrollbars to a window.
  3. Facade Pattern
    Provides a simplified interface to a complex subsystem.

    • Example: A single entry point for a set of APIs.
  4. Flyweight Pattern
    Reduces memory usage by sharing common parts of objects.

    • Example: Text formatting in a document editor.

Summary Table

PatternIntentExample Use Case
AdapterMake incompatible interfaces work togetherPayment gateway integration
DecoratorAdd responsibilities to objects dynamicallyPizza toppings, UI enhancements
FacadeSimplify interface to a complex subsystemHome theater system, API gateway
FlyweightShare objects to minimize memory usageForest of trees