Send a suggestion!

We're building a brand new version of the site, and we'd love to hear your ideas

Members

Technology Zones

IBM Learning Center

Articles

Hosted By

MaximumASP

Info

Rated
Read 43,267 times

Contents

Related Categories

Leverage the .NET Framework with Visual Basic.NET - New Features

ggarung

New Features

Inheritance

One of the biggest enhancements in the .Net platform is the ability to use Inheritance. VB5 introduced "interface inheritance" which allowed VB developers some ability to extend existing objects. Unfortunately it only provided access to the interface and not the underlying implementation.

In VB5 or VB6, for example, you could create an "Person" object that handled basic properties such as Name, Address,Age, etc. If you then wanted to create new objects, such as "Employee", "Student", "Customer" or whatever you could not simply extend the existing Person object. Instead, you had the choice of duplicating the code in the new objects or using delegation by having the new object create an instance of the "Person" object and calling it's methods and properties whenever your code called methods or properties of the extended object.

With VB.Net we now have full inheritance. Your "Employee" object, for example, can inherit the "Person" object along with all of the debugged code it contains to validate, save and retrieve the data it manages. You can then just add the new features that you need to support an "Employee". You can also override, overload or shadow methods and properties of the base class if you need to alter the standard behavior in some way.

Inheritance also applies to visual objects like controls and forms. It will be possible in VB.Net to create a base form that includes corporate logos, standard menus, help systems, etc and then inherit from them to create application-specific forms that have the identical look and feel as all other forms.

Console Applications

VB.Net can easily create true console applications making it possible to write components to be called from command lines, logon scripts or batch processes and have them interact with the standard input and output files.

Delegates

A "delegate" in VB.Net acts somewhat like function pointers in C; they allow you to pass procedure references around and to call those procedures. This can be a very powerful technique, allowing you to call custom sort or other processing routines without needing to hard-code IF or Select blocks.

Function Overloads

VB.Net offers developers the ability to overload functions to provide different functionality based on the number of type of arguments passed. In earlier versions of VB this was often done using optional parameters or ParamArrays but often required a fair amount of coding to determine what was passed and changes could be awkward to implement without breaking compatibility. With VB.Net it is possible to have multiple procedures with the same name but different argument "signatures" that allow the compiler to determine which routine is being called.

G.Gnana Arun Ganesh is the Administrator and the Founder of ARUN MICRO SYSTEMS (www.arunmicrosystems.netfirms.com). He has been programming in C++, Visual Basic, COM, Java and Microsoft Technologies for 3+ years. Arun's background includes Bachelor degree in ECE.He is one of the Top authors writing articles in C# and .NET in various websites. He is an Active person in the panel of Technical Reviewers in Prentice Hall Publishers and Sams Publication. In .NET the last book he reviewed is the "C# how to program" written by Harvey and Paul Deitel. You can contact him through ggarung@rediffmail.com

Comments

  • re-install

    Posted by trooper on 05 Oct 2004

    re-install your prerequisites cd this will correct the problem.

  • reply

    Posted by trooper on 05 Oct 2004

    to create an actual installation cd-rom for your application you would copy the entire contents of the Release folder to writable cd-rom at this point. If the target computers don't include the .net f...

  • How to distribute small application in vb.net to m

    Posted by riaz_muhammad on 10 Mar 2004

    hello, I developed application in visual basic .net and when i tried to run this application in other computers then setup file prompt me message to first install the .net framework in the computer th...

  • Posted by JamesLang on 03 Jun 2003

    You probably figured this out by now but for anyone else with the same or similar problem looking for the old VB6 control array then you need to delegate the Event to a helper method.

    The helper m...

  • object names in arrays

    Posted by r.tulloch on 02 Apr 2003

    In my current project I have to check the state of a number of radio buttons. For example if I have to check the state of 100 buttons do I have to do each one individually, e.g.

    if radState0.checke...