Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What is the Whole-part and Part-whole object relationship?

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.

like image 960
Milad Khajavi Avatar asked Apr 01 '13 14:04

Milad Khajavi


People also ask

What is the relationship of a part and a whole?

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.

What is the part of relationship?

All healthy relationships share the following three core components: Mutual respect. Mutual trust. Mutual affection.

What is whole part hierarchy?

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.


1 Answers

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.

like image 57
SomeWittyUsername Avatar answered Oct 21 '22 14:10

SomeWittyUsername