I have a class A which implements many functions. Class A is very stable. Now I have a new feature requirement, some of whose functionality matches that implemented by A. I cannot directly inherit my new class from class A, as that would bring lot of redundancy into my new class.
So, should i duplicate the common code in both the classes?
Or, should i create a new base class and move the common code to base class, and derive class A and the new class from it? But this will lead to changes in my existing class.
So, which would be a better approach?