Structural Design Patterns

Learn about structural design patterns.

Whereas creational design patterns focus on object creation, structural design patterns take a step back and discuss how system components are related to one another. Though these do have in-code representations, and that is often what people look to for examples, we’ll be using the design approach because these patterns will come up in the system designs and architectural landscapes that we’ll cover later.

Adapter pattern

The adapter pattern is used to convert between different object types, which often may serve similar purposes. From a code perspective, it’s similar to an abstract class and the classes that extend them. From a system perspective, think of a currency conversion system. Each bank has its own currency conversion system, and we may need to interface with multiple banks depending on the currency we're converting. Instead of custom integrations for each bank, we can use an adapter to take the common data model used by our internal systems and convert it to the specific need of the bank we're calling. The figure below illustrates what this might look like:

Get hands-on with 1200+ tech skills courses.