[Design] Inheritance VS Composition

(referring to composition)
"We call this black box reuse. You have a container, and you plug in some smaller object. These smaller objects configure the container and customize the behavour of the container. This is possible since the container delegates some behaviour to the smaller thing.
In the end you get customization by configuration."

(from Erich Gamma: http://www.artima.com/lejava/articles/designprinciplesP.html)

Nessun commento: