Structural Pattern

Category

Structural patterns describe ways to deal with relationships between entities, components or classes.

Patterns

Adapter

Structural Pattern

The adapter pattern is a design pattern that is used to allow two incompatible types to communicate. Where one class relies upon a specific interface that is not implemented by another class, the adapter acts as a translator between the two types.

Bridge

Structural Pattern

The bridge pattern is a design pattern that separates the abstract elements of a class from its technical implementation. This provides a cleaner implementation of real-world objects and allows the implementation details to be changed easily.

Composite

Structural Pattern

The composite pattern describes a way to create tree structures using objects and object groups. The clients can access and use individual objects and compositions in the same manner.

Composition Root

Structural Pattern

A Composition Root is a (preferably) unique location in an application where modules are composed together.

Decorator

Structural Pattern

A decorator allows to add behavior to an individual object, either statically or dynamically, without affecting the behavior of other objects from the same class.

Extension Object

Structural Pattern

Attach additional methods to a class. Whereas Decorator requires that the core class's interface remain fixed as successive "wrappers" are applied, Extension Objects allow the class's interface to grow incrementally and dynamically.

Facade

Structural Pattern

The facade pattern is used to define a simplified interface to a more complex subsystem.

Flyweight

Structural Pattern

The flyweight pattern is used to reduce the memory and resource usage for complex models containing many hundreds, thousands or hundreds of thousands of similar objects.

Pimpl Idiom

Structural Pattern

The PIMPL Idiom (Pointer to IMPLementation) is a technique for implementation hiding in which a public class wraps a structure or class that cannot be seen outside the library the public class is part of.

Proxy

Structural Pattern

The proxy pattern is used to provide a surrogate or placeholder object, which references an underlying object. The proxy provides the same public interface as the underlying subject class, adding a level of indirection by accepting requests from a client object and passing these to the real subject object as necessary.

Service Locator

Structural Pattern

The service locator pattern encapsulates the processes involved in obtaining a service with a strong abstraction layer. The pattern uses a central registry known as the "service locator", which on request returns the information necessary to perform a certain task. The pattern is often considered an anti-pattern, because it hides the dependencies of class (in contrast to constructor injection).

Type Object

Structural Pattern

Decouple instances from their classes so that those classes can be implemented as instances of a class. Type Object allows new "classes" to be created dynamically at runtime, lets a system provide its own type−checking rules, and can lead to simpler, smaller systems.

Whole-Part

Structural Pattern

The Whole-Part design pattern helps with the aggregation of components that together form a semantic unit. An aggregate component, the Whole, encapsulates it constituent components, the Parts, organises their collaboration, and provides a common interface to its functionality. Direct access to the Parts is not possible.