Understanding Structural Patterns
This chapter examines structural patterns in Kotlin, focusing on how objects are composed and arranged within larger structures. These patterns aim to simplify the interactions and relationships between different components of our system.
We will discuss how to enhance the functionality of our objects without creating complex class hierarchies. Additionally, we’ll explore methods to adapt to future changes and rectify design decisions made in the past. Furthermore, we’ll examine techniques for reducing the memory footprint of our programs.
Throughout this chapter, we will cover the following patterns:
- Decorator
- Adapter
- Bridge
- Composite
- Facade
- Flyweight
- Proxy
By the end of this chapter, you will have a better understanding of how to compose your objects in a way that enables simpler extension and adaptation to various types of changes.
As we have observed in the previous...