Structural Design Patterns

Structural Design Patterns

Structural Design Pattern

A structural design pattern is a category of Design patterns that provides new functionality while preserving these structures flexible and efficient. It also combines different classes and objects to form more extensive networks and provide new functionality while keeping these structures adaptable and useful.

 Mostly they use Inheritance to compose all the interfaces. Structural Design Patterns are used to assemble multiple classes into more significant working structures. They’re handy for creating readable, maintainable, layered code, especially when working with external libraries, legacy code, interdependent classes, or numerous objects.

Types of Structural Design Pattern

  • Adapter
    • From our phone charger, we will notice there are an adapter and the USB cord that we connect to the socket. This adapter is used for connecting or interfacing different brands of phone fibres. So also, the adapter is a structural design pattern that provides objects with incompatible interfaces to collaborate.
  • Bridge
    • A bridge method is a structural design pattern that permits us to separate big classes(large classes) into two separate classes (hierarchies), and the implementation can be improved autonomously.
  • Composite
    • Composite is a type of structural design pattern that allows us to compose objects into tree-like structures and then operate with these structures as if they were single objects. 
  • Decorator
    • Decorator method is a type of structural design pattern that lets us assign new behaviours to objects by storing these objects inside unique wrapper objects that carry the actions.
  • Facade
    • The facade is a structural design pattern that provides us with an uncomplicated interface to a framework, a library, or any other complex set of classes.