/CompositeDesignPattern

Go4 Design Patterns - Composite Design Pattern Example

Primary LanguageC#

Composite Design Pattern:

- Used to compose objects in to a hierchy of structure
- Eg: XML

<1>//Composite - Container of other component
	<1.1>//Composite
 		<1.1.1>//Leaf - End Node; Doesn't contain any other component
		</1.1.1>
	</1.1>
	<1.2>
		<1.2.1>
		</1.2.1>

	</1.2>

</1>


Anytime, 
If we want to represent object in hierachy of tree; we have to use composite design pattern

References:
https://www.youtube.com/watch?v=HTKz7TI644g	
https://sourcemaking.com/design_patterns/composite