less than 1 minute read

favour composition over inheritance.
even though you have common code in the base class and child classes uses those methods it is better to move those common methods to another class and then the child classes have instances of those classes with those methods for accessing.
lots of common code in base classes leads to child classes changing inheritances and can lead to unstable code.

Comments