I have a class A that implements many functions. Class A is very stable.
Now I have a new requirement for functions, some of which correspond to functions A. I cannot directly inherit my new class from class A, as this will bring a lot of redundancy to my new class.
So, should I duplicate common code in both classes?
Or, should I create a new base class and transfer the common code to the base class and deduce from it class A and the new class? But this will lead to changes in my existing class.
So what would be a better approach?
source
share