Open In App

Structural Design Patterns

Structural Design Patterns are concerned with how classes and objects are composed to form larger structures. Structural class patterns use inheritance to compose interfaces or implementations.



Consider how multiple inheritances mix two or more classes into one. The result is a class that combines the properties of its parent classes.

There are two recurring themes in these patterns:



Example for Structural Design Patterns

Consider an example, a drawing editor that lets users draw and arrange graphical elements (lines, polygons, text, etc.) into pictures and diagrams. The drawing editor’s key abstraction is the graphical object, which has an editable shape and can draw itself.

The interface for graphical objects is defined by an abstract class called Shape. The editor defines a subclass of the Shape for each kind of graphical object: a LineShape class for lines, a PolygonShape class for polygons, and so forth.

Types of Structural Design Patterns:

Adapter Method Design Patterns:

Adapter Method or Adapter Design Patterns also knows as wrapper. It convert the interface of a class into another interface clients expect. Adapter lets classes work together that couldn’t otherwise because of incompatible interfaces.

When to use Adapter Method

Bridge Method Design Patterns

Bridge Method or Bridge Design Patterns also known as Handle/Body. Decouple an abstraction from its implementation so that the two can vary independently.

When to use Bridge Method

Composite Method Design Patterns

Composite Method or Composite Design Patterns it compose objects into tree structures to represent part-whole hierarchies. Composite lets clients treat individual objects and compositions of objects uniformly.

When to use Composite Method

Decorator Method Design Patterns

Decorator Method or Decorator Design Patterns also known as wrapper, it is attach with additional responsibilities to an object dynamically. Decorators provide a flexible alternative to subclassing for extending functionality.

When to use Decorator Method

Facade Method Design Patterns

Facade method or Facade Design Pattern it provide a unified interface to a set of interfaces in a subsystem. Facade defines a higher-level interface that makes the subsystem easier to use.

When to use Facade Method

Flyweight Method Design Patterns

Flyweight method or Flyweight Design Patterns, it is used to support large numbers of fine-grained objects efficiently.

When to use Flyweight Method

Proxy Method Design Patterns

Proxy Method or Proxy Design Pattern also known as Surrogate, it provide a surrogate or placeholder for another object to control access to it.

When to use Proxy Method

Proxy method is applicable whenever there is a need for a more versatile or sophisticated reference to an object than a simple pointer. Here are several common situations in which the Proxy pattern is applicable:


Article Tags :