Structural patterns organize relationships between objects. They solve different boundary problems: incompatible interfaces, recursive part-whole trees, independently changing dimensions, layered behavior, simplified subsystem access, shared intrinsic state, and controlled access. The right pattern follows from the relationship that must remain stable.

Patterns at a Glance

These patterns can share nearly identical class diagrams while serving different intents. Decorator and Proxy both wrap an interface. Adapter and Facade both sit at a boundary. Selection depends on whether the design needs translation, simplification, behavior, access control, hierarchy, independent variation, or memory sharing. Several may coexist in one system.

PatternIntentReach for it when
Software Architecture/Patterns/Design Patterns/Structural/AdapterTranslate an existing interface into the contract a client expects.A legacy or third-party API cannot be changed, but the client requires another shape.
Software Architecture/Patterns/Design Patterns/Structural/BridgeSeparate an abstraction from its implementation so both dimensions can vary.Two independent dimensions would otherwise produce an N×M set of classes.
Software Architecture/Patterns/Design Patterns/Structural/CompositeRepresent part-whole trees through one component interface.Clients should apply the same operation to a leaf or a group.
Software Architecture/Patterns/Design Patterns/Structural/DecoratorAdd behavior through same-interface wrappers.Optional behaviors need explicit composition without subclassing.
Software Architecture/Patterns/Design Patterns/Structural/FacadePresent a high-level entry point over a complex subsystem.Several clients repeat the same subsystem workflow.
Software Architecture/Patterns/Design Patterns/Structural/FlyweightShare immutable intrinsic state across many fine-grained objects.Retained duplicate state is a measured memory cost.
Software Architecture/Patterns/Design Patterns/Structural/ProxyControl access through a same-interface surrogate.Access must be deferred, cached, authorized, or made remote without changing clients.

Questions

References

7 items under this folder.