I have a statement. I know the ups and downs of both Composition and Inheritance, but I am unable to realize that what would be the best option the given scenario.
A Software company is developing a website for a university using a multiple inheritance between classes. The classes include Person, Teacher, Student, GradStudent, GradTeachAsst.
For some reasons, the project design team decided not to use multiple inheritance for GradTeachAsst class, and give two alternatives. One is to use Composition and other is combination of Single Inheritance with Composition. Being a software developer which option you will select? Justify your answer with good reasons.
In my opinion, the best scenario would be to chose the
Composition. But I am not getting the reasons in my mind. Can anyone explain me the solid reasons?