Structural Software Design Patterns
Structural design patterns are a way of structuring code to make it more maintainable and flexible by re-using solutions to common problems. The idea stemmed from the book “Design Patterns: Elements of Reusable Object-Oriented Software” written by the Gang of Four which aims to provide a set of guidelines for implementing great software solutions.
Structural class patterns are concerned with:
- How classes are structured and interact with each other
- Focus on inheritance to create structures
- Makes use of interfaces to define shared functionality
Structural object patterns are concerned with:
- Object composition
- Enable objects to change behavior at runtime
The adapter pattern
Where applications cannot integrate easily because of incompatible interfaces, the adapter pattern could be used when:
- You can’t change the source, which is common in a proprietary third-party applications where you don’t have access to the source code.
- Legacy code has to be reused but you don’t want to refactor an older piece of technology
- You want to use an existing class but that class does not fit into your class hierarchy
Examples of the adapter pattern are implemented in the JDK Collections classes for both the java.util.Collections.list() & java.util.Collections.enumeration() methods that provide compatibility with legacy APIs that work with enumerations.
The bridge pattern
The bridge pattern is used to simplify inheritance hierarchies to make them more flexible and adaptable. The bridge pattern enables the separation of hierarchies and instantiates an object based on it’s characteristics without having to create a concrete class for it’s implementation.
The bridge pattern is commonly implemented for graphical user interfaces (GUI) to implement objects that share similar attributes, for example, different colors/shapes of buttons on a GUI.

