Take two base classes A and B which are similar but are preferred to be distinct. Each has a sub class (A’ and B’) which add the same functionality and members to their respective classes. Is there a design pattern to allow me to not have to duplicate code in A’ and B’?
I’ve looked at Bridge and Decorator, but I can’t see how these would work.
Thanks,
Rob
Could you use composition and refactor the shared code to another class C?