I've been coding for about 8 years, however I still find inheritance is too flexible and sometimes it makes you totally confused with the code you have written. One simplest example would be:
abstract class AClass {
protected void method1() {
if(check()) {
do1();
} else {
do2();
}
}
protected abstract void do1();
protected abstract void do2();
}
The intention of the class is that people can implement do1() and do2() so that some further logic can be done, however sometimes people decide to overload method1(), and then things become complicated immediately.
I find only in strategy pattern, code is reused well through inheritance, in most case the designer of the base class know its subclasses very well, and that inheritance is totally optional.
I have a class that's inherited by 4 classes - an IoHandler, and it's subclasses for server side, client side, edge server, origin server, and it begins to drive me crazy. I was always in code refactoring, I always came out with ideas I think would work and then were proven not. It's said that human brain can only hold 7 pieces of information one time, am I carrying too many?