Chapter 9 Inheritance 1. One of the keys to the power of OOP is achieving software reusability through inheritance. 2. The programmer can designate that the new class is to inherit the data members and member functions of a previously defined base class. In this case, the new class is referred as a derived class. 3. A derived class normally adds data members and member functions of its own. so a derived class generally has a larger definition than its base class. A derived class is more specific than its base class and normally represents fewer objects. 4. A derived class cannot access the private members of its base class; allowing this would violate the encapsulation of the base class. A derived class can however access the public and protected members of its base class. 5. Inheritance enables software reusability which saves time in development and encourages the use of previously proven and debugged high-quality software. 6. Inheritance can be accomplished from existing class libraries. 7. Someday, most of software will be constructed from standardized reusable components exactly as most hardware is constructed today. 8. The implementor of the derived class does not need access to the source code of a base class, but does need the interface to the base class and the base class's object code. 9. An inheritance hierarchy can be arbitrarily deep within the physical limitations of a particular system. 10. Hierarchies are useful tools for understanding and managing complexity. With software becoming increasingly complex, C++ provides mechanisms for supporting hierarchical structures through inheritance and polymorphism. 11. Protected members of a base class may be accessed by members and friends of the base class and by members and friends of derived classes; no other functions can access the protected members of a base class. 12. Protected members are used to extend privileges to derived classes while denying those privileges to non-class, non-friend functions. 13. When deriving a class from a private base class, public and protected members of the base class become private members of the derived class. 14. When a base-class member is inappropriate for a derived class, we may simply redefine that member in the derived class. 15. A base class specifies commonality. All classes derived from a base class inherit the capabilities of that base class. In the OOD process, the designer looks for commonality and factors it out to form desired base classes. Derived classes are then customized beyond the capabilities inherited from the base class. 16. Indicate multiple inheritance by following the colon (:) inheritance indicator with a comma-separated list of the base class. 17. When performance is a major concern, programmers may want to see source code of classes they are inheriting from so they can tune the code to meet their performance requirements. 18. Inheritance from the class "closest" to what you need to save time and space. 19. A derived class can not directly access private members of its base class.