Would like to know the best way to handle this situation. How it would be possible to avoid duplicate element.
class ABO -> Need method A and B
method C
class AO : O
method A
class BO : O
method B
class O
Thanks!
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
You could avoid inheritance. If you only need a functionality and not an IS-A relationship, just use composition.
Hold 2 local members of the needed classes, and create a wrapper function that will call the member’s functions.
C-like pseudo code example: