ignacionr2
Favorite Answer
An alternative to inheritance is containment. You may have a component that needs to extend another component.
If you cannot in a practical way use inheritance (i.e. you don't have a cross-language possibility, or access to the source code, like with COM -the Component Object Model-, or if you would need to inherit the behaviour of more than one component and your language doesn't allow for multiple inheritance) you may implement the base object's interface and delegate every call made to your new class into the contained object, changing and extending whatever part of the original behaviour you may find appropiate.
Bubala
A lot of copy-and-pasting. The whole point behind inheritance is to expand on an existing class. You're perfectly able to create all your classes apart from eachother, but if they differ only in a few areas, you're better off creating a base class with the common functionality and then creating subclasses that expand on that functionality in specific ways.