O'Reilly logo

Visual Basic Design Patterns: VB 6.0 and VB.NET by James W. Cooper

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Chapter 6. Inheritance and Interfaces

As you begin to work more with classes, you soon come across programming cases where you have classes that are similar to others you are already using in this program or another one. It seems a shame to just copy all that code over again and have a lot of objects that are separate but very alike.

In languages like Java and VB.NET, you can derive new classes from existing classes and change only those methods that differ in the new class, with the unchanged parent methods called automatically. VB6 does not support this level of inheritance, but it does provide interfaces and implementations that allow you to produce related classes with only a small amount of effort.

Interfaces

In VB, you can create a class containing ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required