Structural design patterns explain how to assemble objects and classes into larger structures while keeping these structures flexible and efficient.
One Shot Video: Structural Design Patterns in One Shot
Structural design patterns focus on how classes and objects are composed to form larger structures, ensuring that if one part changes, the entire structure doesn't need to do the same. They help ensure that systems are easier to design, understand, and maintain.
- Decorator - Allows behavior to be added to individual objects dynamically without affecting other objects from the same class
- Proxy - Provides a surrogate or placeholder for another object to control access to it
- Composite - Composes objects into tree structures to represent part-whole hierarchies
- Adapter - Allows the interface of an existing class to be used as another interface
- Bridge - Decouples an abstraction from its implementation so that the two can vary independently
- Facade - Provides a unified interface to a set of interfaces in a subsystem, making it easier to use
- Flyweight - Reduces the cost of creating and manipulating a large number of similar objects by sharing as much data as possible
- GeeksforGeeks: Decorator Design Pattern
- SourceMaking: Decorator Pattern
- Decorator Pattern in Python (Hindi): YouTube
Attach additional responsibilities to an object dynamically. Decorators provide a flexible alternative to subclassing for extending functionality.
- GeeksforGeeks: Proxy Design Pattern
- SourceMaking: Proxy Pattern
- Proxy Pattern in Python (Hindi): YouTube
Provide a surrogate or placeholder for another object to control access to it.
- GeeksforGeeks: Composite Design Pattern in Java
- SourceMaking: Composite Pattern
- Composite Pattern in Python (Hindi): YouTube
Compose objects into tree structures to represent part-whole hierarchies. Composite lets clients treat individual objects and compositions of objects uniformly.
- GeeksforGeeks: Adapter Pattern
- SourceMaking: Adapter Pattern
- Adapter Pattern in Python (Hindi): YouTube
Convert the interface of a class into another interface clients expect. Adapter lets classes work together that couldn't otherwise because of incompatible interfaces.
- GeeksforGeeks: Bridge Design Pattern
- SourceMaking: Bridge Pattern
- Bridge Pattern in Python (Hindi): YouTube
Decouple an abstraction from its implementation so that the two can vary independently.
- GeeksforGeeks: Facade Design Pattern
- SourceMaking: Facade Pattern
- Facade Pattern in Python (Hindi): YouTube
Provide a unified interface to a set of interfaces in a subsystem. Facade defines a high-level interface that makes the subsystem easier to use.
- GeeksforGeeks: Flyweight Design Pattern
- SourceMaking: Flyweight Pattern
- Flyweight Pattern in Python (Hindi): YouTube
Use sharing to support large numbers of fine-grained objects efficiently.