Structural patterns are the Gang of Four family that answers how do objects fit together into larger structures? — mostly by taking objects that already exist and arranging them so the whole stays flexible.12
What they are for
Real systems are assembled from parts written at different times by different people — a third-party driver, your own code, a UI toolkit. Getting them to cooperate without welding them tightly together is the recurring problem these patterns address. They share a family resemblance: most involve one object wrapping another, and all lean on programming to an interface so dependencies point at the contract rather than concrete classes, keeping coupling low.1
The main members
- Adapter — converts one object’s interface into the one a client expects; the universal travel plug of software, wrapping a single object to fix compatibility.
- Facade — a brand-new, simpler interface in front of a whole subsystem, fixing complexity by offering one easy entry point.
- Decorator — wraps an object with the same interface to add behavior (logging, gain) that stacks in any order at runtime, avoiding a subclass explosion.
- Proxy — stands in for another object to control access, add caching, or defer work.
- Composite — treats individual objects and groups of them uniformly through one interface.
- Bridge — separates an abstraction from its implementation so they vary independently.
A subtle distinction
Adapter and Decorator look structurally identical — both wrap an object — but the intent differs: Adapter changes the interface to make things fit, while Decorator keeps the interface the same and adds behavior. Knowing the pattern names is exactly what lets a team distinguish them when discussing a design. The sibling families are creational patterns (making objects) and behavioral patterns (coordinating them), and all three support the open/closed principle from SOLID.
Sources
-
Structural pattern — Wikipedia, for the definition, the wrapping mechanism, and members such as Adapter, Facade, and Decorator. ↩ ↩2
-
Design Patterns — Wikipedia, on the 1994 Gang of Four book that grouped patterns into creational, structural, and behavioral families. ↩