Composite Pattern
From Logic Wiki
Revision as of 17:01, 31 January 2019 by AliIybar (Talk | contribs) (Created page with "Category:Extreme Programming Category:Design Patterns Category:OOP == Video == [https://www.youtube.com/watch?v=EWDmWbJ4wRA https://www.youtube.com/watch?v=EWDmWb...")
Video
https://www.youtube.com/watch?v=EWDmWbJ4wRA
Definition
Composite pattern is used where we need to treat a group of objects in similar way as a single object. Composite pattern composes objects in term of a tree structure to represent part as well as whole hierarchy. This type of design pattern comes under structural pattern as this pattern creates a tree structure of group of objects.
This pattern creates a class that contains group of its own objects. This class provides ways to modify its group of same objects.
We are demonstrating use of composite pattern via following example in which we will show employees hierarchy of an organization.
