A behavioral pattern which lets you define new methods to a class hierarchy without changing the class hierarchy on which it operates
1. When the primary class hierarchy is fixed or it is coming from a different vendor and you cannot make any changes to that hierarchy
2. Several different operations have to be performed on all or some of the classes in the hierarchy
Visitor and Composite Pattern normally go hand in hand together. First, we will try to create an example of composite pattern. A composite pattern is a structural pattern which helps to create tree like hierarchial structures. Consider a linux filesystem where every element is considered as a file. We are trying to achieve the same tree structure using
Linkelements. All of these classes implement the interface
Read more ...