Applying Structural Design Patterns
Every piece of software has a purpose or, in other words, an expected behavior that it should fulfill. While the previous chapter described in detail creational design patterns, this chapter will focus on designing maintainable and flexible source code for objects created. Structural patterns attempt to bring clarity to relationships between created instances, not only to maintain an application but also to easily understand its purpose. Let us dive deeper and start examining the following topics:
- Incompatible object collaboration with the adapter pattern
- Decoupling and developing objects independently with the bridge pattern
- Treating objects the same way using the composite pattern
- Extending object functionality by using the decorator pattern
- Simplifying communication with the facade pattern
- Using conditions to select desired objects with the filter pattern
- Sharing objects across an application with the flyweight pattern
- Handling requests with the front-controller pattern
- Identifying instances using the marker pattern
- Exploring the concept of modules with the module pattern
- Providing a placeholder for an object employing the proxy pattern
- Discovering multiple inheritance in Java with the twin pattern
By the end of this chapter, you’ll have a solid understanding of how to structure a code base around created instances.