Members

Technology Zones

Articles

Hosted By

MaximumASP

Info

Rated
Read 100,236 times

Contents

Related Categories

New Object-Oriented Capabilities in VB.NET - Summary

Wrox

Summary

Visual Inheritance

So far we’ve been discussing the new OO features of the VB.NET language, with a large focus on inheritance.

However, VB.NET also supports visual inheritance for Windows Forms. This means that we can create a Windows Forms form, and then inherit from that form to create other forms that have the same layout, controls, and behaviors. This topic was covered in more detail in Chapter 4.

We can also use inheritance to create our own versions of Windows Forms controls. For instance, we may want to create an enhanced TextBox control that performs some specialized validation of the input data. This can be accomplished through inheritance by creating a subclass of the original TextBox control class and enhancing it as needed. This was also covered in Chapter 4.

The same is true of Web Forms controls, where we can take an existing Web Forms control and create a subclass. Our subclass can override existing functionality or add new functionality as required. See Chapter 6 for more on this.

Summary

Of all the features requested for the new version of VB, perhaps the most common was true inheritance. As we’ve seen in this chapter, not only does VB.NET provide us with inheritance, but we also gain a number of other important new features and enhancements.

VB.NET dramatically enhances the way we create and work with multiple interfaces, making them far easier to use than in the past. Additionally, through the support for events as being a formal part of an interface, we can now express all the elements of an interface through this mechanism – methods, properties, and events.

For most people, the elimination of reference counting in favor of a garbage collection scheme for object termination will be a non-issue. However, it is important to be aware of this change, since an object that maintains a reference to expensive system resources will need some mechanism other than its termination to release those valuable resources.

Overall, VB.NET dramatically enhances our ability to create OO applications with VB, while preserving the vast majority of the features we have become used to in previous versions of the language.


Copyright © Wrox Press Limited 2001; all rights reserved.

No part of this chapter may be reproduced, stored in a retrieval system or transmitted in any form or by any means -- electronic, electrostatic, mechanical, photocopying, recording or ot

Comments

  • Posted by aussieVB on 12 May 2005

    application level

  • raising base class events

    Posted by slkillick on 04 Nov 2004

    [quote][1]Posted by [b]bsol[/b] on 19 Mar 2004 04:06 PM[/1]
    Error in the article "New Object-Oriented Capabilities in VB.NET - Events"

    Derived classes cannot raise base class events in VB.Net. Han...

  • raising base class events

    Posted by bsol on 19 Mar 2004

    Error in the article "New Object-Oriented Capabilities in VB.NET - Events"

    Derived classes cannot raise base class events in VB.Net. Handle them sure, but not raise them - even if they are declared...

  • VB.NET

    Posted by ssudhakar on 02 Jul 2003

    How do we read the attributes in an XML file using a DataSet?

  • Global Variable Declaration

    Posted by gshuston on 24 Feb 2003

    boig,

    I needed the same thing and found that I have it working using the Public Shared declaration on the class that contains my XMLDocument and the functions to access the document. This makes th...