Summary

Team-Fly    

 
Visual Basic .NET Unleashed
By Paul Kimmel
Table of Contents
Chapter 10.  Inheritance and Polymorphism

Summary

Visual Basic .NET supports inheritance. In addition to defining and implementing interfaces, Visual Basic .NET supports class inheritance. Because of the incorporation of class inheritance in Visual Basic .NET, you now have three kinds of polymorphism to choose from: interface polymorphism, inheritance polymorphism, and abstract polymorphism.

Use inheritance to support subclassing when you want to generalize an existing class, and use interface polymorphism when you need to support similar capabilities across disparate classes. Abstract classes allow you to combine constraining an interface with inheritance. When you are defining classes, keep an eye out for conditional behavior or select case statements. Type codes that are used to determine dynamic behavior usually suggest code that can benefit from a refinement in the class definitions and polymorphic behavior.

Visual Basic .NET supports single class inheritance and multiple interface inheritance. Classes and interfaces can be combined in whatever manner suits your needs. If a class describes a specialized type of an existing class, use inheritance. Alternatively, if you need to create an adapter that provides access to a concise set of capabilities, implement an interface.


Team-Fly    
Top
 


Visual BasicR. NET Unleashed
Visual BasicR. NET Unleashed
ISBN: N/A
EAN: N/A
Year: 2001
Pages: 222

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net