Quantcast
Channel: CSharp Forum Latest Questions
Viewing all articles
Browse latest Browse all 32152

Where we can apply composite pattern in real life ?

$
0
0
Hi people,

I am sharing one real example, and expecting one example from your side.

First we see what is the definition of Composite Pattern ?

"Compose objects into tree structures to represent part-whole hierarchies. Composite lets the clients treat individual objects and composition of objects individually."

Leaves and branches of tree treated as Same. (No distinction)

Real Example:
Suppose you are an HR office in a company, and you send the same email notice to different people in a company.
If you are write email address of individuals in "To" box. I will recommend you to apply composite pattern for it. Make it sample and create Group of individuals.

Thanks,
Mursaleen Fayyaz
Jr.Software Engineer.

Viewing all articles
Browse latest Browse all 32152

Trending Articles