Deep hierarchies increase the chances that this chaining will be called inappropriately, causing coding errors. Inheritance instead of containment. Designs that use inheritance when containment is appropriate have all of the complexities of inheritance with none of the advantages. To put it another way, designers should always use containment unless there is a need to override the behavior of the class or unless the class must be used polymorphically. Kitchen sink classes.
Many designers create all-purpose base classes that support all possible features.
Classes derived from such a base class must understand the behavior of all public and protected methods in order to ensure proper behavior. These complex classes often convince developers to create new classes and hierarchies, subverting reuse. The designers of this class include all methods that a window or any of its derivations could ever use. There are methods for handling selections in list boxes, edit boxes, and buttons, even though any given window may only be one of these types, if any, at a time. The inclusion of so many methods in the base class makes the interface very difficult to use and creates many methods that don't apply to any subclass of CWin .