Is this composite pattern implementation proper?
Hi Refer code below which I did for composite pattern demo: https://www.sololearn.com/compiler-playground/c8i3yyr0wNWx Feel free to share your views on same. Any improvement advice is most welcome. Also I have two doubts as below : 1. This design is validating Interface Segregation Principle due to AddReportee() and RemoveReportee(). These two methods are not required for Individuals class , but required for Manager class. If I remove it from Employee Interface, Composite pattern is violated and don't have option to do same thing on leaf and components. If we don't remove, It violates Interface Segregation. How to overcome this issue? 2. Suppose now spHR2 becomes manager for someone. So, How to add reportees to him as It is object of Individuals type. P.S. : Adding one more point: 3. Is list data member is proper data structure choice for manager class? https://code.sololearn.com/c8i3yyr0wNWx/?ref=app