3 ms·
Here's a pretty good comparison of the two techniques: http://www.artima.com/designtechniques/compoinhP.html http://www.artima.com/designtechniques/compoinhP.ht
by mrshoe 16y ago
Here's a pretty good comparison of the two techniques: http://www.artima.com/designtechniques/compoinhP.html http://www.artima.com/designtechniques/compoinhP.html
Having worked with a lot of C++ code recently that employs both methods, I personally prefer inheritance for the majority of cases. One of my primary goals while writing code is to write as little code as possible. If I have to write wrapper methods to expose the interface of the back-end class I've composed, then I'm not achieving that goal.