Building a Complex Object Hierarchy
Explore how to apply the Composite design pattern to build complex object hierarchies like tree structures. Understand the roles of leaf and composite classes, and learn to create maintainable and extensible code representing containers and contained objects in software design.
We'll cover the following...
We'll cover the following...
Let’s imagine that we need to construct a structure where objects need to act as containers for similar objects. It could be that we’re building a tree-like data structure. Perhaps we’re building a representation of a file storage system where folders can contain files and other folders.
Suitable design pattern
Let’s discuss the design ...