oop - Can one inherited class "contain" object of another inherited class when both the inherited class belong to the same base class? -


i thinking of creating oop model of "request tracker".

so, thought following:

parent class: requestorresponse (containing common fields of request , response such id, date, item involved, user, quantity).

child classes: 1. request (with data members: priority, status, remaining quantity), 2. response (with data member relatedrequest)

response class has data member object of request.

yes; there's no general reason why should not work.


Comments