What Is Inheritance?
Let's assume you need to model and program a Human Resources (HR) system, which deals with the employees of the company and customer contacts, among other entities. The approach based on what you know today (and what you would do in a previous version of Visual Basic) would be to design two classes: one for employees and one for customer contacts. They would look like the UML diagram in Figure 17.1 and be implemented as shown in the code that follows.
Figure 17.1. Class diagram for the Employee and Customer classes.
The implementation for the Employee class would be:
Public Class Employee Private m_name As String Private m_dob ...
Get Visual Basic® .NET by Example now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.