I'm reading Head First Design Patterns book, on page 382 it says:
Composite Patterns is used when you have collection of objects with Whole-Part relationships. and you want to be able to treat those objects uniformly.
The common sense idea that the sum of the parts will be equal to the whole is not always true, and what is truer still is: The whole is more than the sum of the parts because the whole belongs to a higher plane than the parts.
All healthy relationships share the following three core components: Mutual respect. Mutual trust. Mutual affection.
A system consists of subsystems or components. Components can further be divided into smaller components. Further smaller components can be divided into smaller elements. This is a part-whole hierarchy. Everything around us can be a candidate for part-whole hierarchy.
Well, it's pretty straightforward - any object in a collection is a part of the whole composition and composition as a whole is a collection of parts.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With