I remembered that I read once in a book that teaches
try to use composition as far as you could. I forgot the reasons now, anyone could give the hint?
I remembered that I read once in a book that teaches
try to use composition as far as you could. I forgot the reasons now, anyone could give the hint?
I had been confused same as you until I found this explanation: Inheritance is Bad: Code Reuse Great example where author explain inheritance based on example typically used to show why inheritance is "great".
Favor 'object composition' over 'class inheritance'. (Gang of Four 1995:20) Read the book