Professional Documents
Culture Documents
Composite Pattern
Composite Pattern
1
Suppose we want to create a menu like this…
2
3
Whole same as Parts
4
5
6
Similarly there are few other methods: getName
7 (), getDescription (), print(), etc
8
9
10
11
12
13
14
15
16
17