The GoF book says there is a lot of similarity between structural patterns because of the few kinds of relationships in object model structures: inheritance and implementation between classes plus object composition, which is the leitmotif of the majority of these patterns.
The greatest advantage of object composition consists in being a relationship which can be established at runtime and basing on configuration without changing actual code, an operation that is required by class inheritance and implementation of interfaces. In fact, ideally you can totally define the functionalities of an application by changing the link between objects, and not the ones between classes, which are part of the design. This will be expanded in the next articles on behavioral patterns.
Here is the list of the structural patterns treated in the GoF book and in this article series.
These three patterns' intent is fighting coupling:
- an Adapter connects objects with different interfaces.
- a Bridge separates a hierarchy of M abstractions and a hierarchy of N implementations into N+M ortoghonal classes instead of M*N use cases.
- a Facade creates a new unified interface to access a subsystem.
These three patterns maintain the same interface of an object whilst they add orthogonal concerns without the client noticing, transparently:
- a Composite implementation adds containers for other objects to organize a hierarchical structure and reuse trees as leafs of other trees.
- a Decorator adds behavior by intercepting methods delegation, avoiding the introduction of an hign number of subclasses.
- a Proxy delegates operations to an object that does not exist yet or is hard to access.