10.6. Software Engineering with InheritanceNovice programmers sometimes have difficulty appreciating the scope of the problems faced by developers who work on large-scale software projects in industry. People experienced with such projects say that effective software reuse improves the software-development process. Object-oriented programming facilitates software reuse, potentially shortening development and maintenance efforts. This section discusses customizing existing software with inheritance. When a new class inherits from an existing class, the new class inherits the non-Private members of the existing class. We can customize the new class to meet our needs by including additional members and by overriding base class members. Doing this does not require the derived class programmer to change the base class's source code. Visual Basic simply requires access to the base class's assembly file so that it can compile and execute any program that uses or inherits the base class. This is attractive to independent software vendors (ISVs) because they develop proprietary classes for sale or license and make them available to users in MSIL format. Users then can derive new classes from these library classes rapidly and without accessing the ISVs' proprietary source code. Software Engineering Observation 10.7
The availability of substantial class libraries helps deliver the maximum benefits of software reuse through inheritance. Application designers build their applications with these libraries, and library designers are compensated when their libraries are included with the applications. The standard Visual Basic class libraries tend to be general purpose. Many special-purpose class libraries exist and more are being created. Software Engineering Observation 10.8
Performance Tip 10.1
Reading derived class declarations can be confusing, because inherited members are not declared explicitly in the derived classes, but are nevertheless present in them. A similar problem exists in documenting derived class members. |