.NET platform does not support multiple inheritance. Do not confuse multilevel inheritance with multiple inheritance. With multiple inheritance we can have a subclass that inherits from two classes at the same time.
Let's suppose we have an application that has a class Customers and another class Vendors. If you wanted to combine these two classes into one CustomerVendor class it would be a combination of Customers and Vendors just like the diagram below.
Please copy the following URL into your browser to view the diagram: http://www.vbprofs.com/images/Article Images/ThomasArt1.gif
In the above diagram we see how the CustomerVendor class inherits from both of those classes.
Multiple inheritance is complex and can be dangerous. The advantages of code re-usage prevail over complexity is up to your choice.
Multiple inheritance is not supported by VB.NET or .Net platform. Instead of multiple inheritance we can use multiple interfaces to achieve similar effect to multiple inheritance.
In VB.NET all objects have a primary or native interface, which is composed of properties, events, methods or member variables declared using Public keyword. Objects can implement also secondary interfaces by using Implement keyword.
Sometimes it is helpful for an object to have more than one interface, allowing us to interact with the object in different ways. Inheritance allow us to create subclasses that are a specialized case of the base class.
Example
Sometimes we have a group of objects that are not the similar, but we want to handle them the same manner. We want all the objects to act as if they are the same, even though they are different.
We can have some different objects in an application, such as customer, product, invoice etc. Each object would have a default interface appropriate to each individual object, and each of them is a different class. No natural inheritance is implied between these classes. Let's suppose we want to print a document for each type of object. In this case we'd like to make them all act as printable object. To accomplish this we can define a generic interface that would enable generating a printed document. By implementing a common interface we are able to write a routine that accepts any object that implements a printed document.
To conclude, by implementing multiple interfaces in VB.NET , we can achieve a similar effect to that of multiple inheritance.
Thomas is an experienced Visual Basic developer, with expertise of 7+ years developing especially financial applications. His main IT skills are VB, SQL, Crystal Reports - should you need a Visual Basic developer for your projects feel free to contact Thomas through his personal website Kaloyani.com or through VBprofs.com - the newest Visual Basic and VB.NET resources portal.
This article illustrates the best practices to improve the performance... Read More
After seeing many people complain about their weak Internet security... Read More
It is a well known fact that Java as a... Read More
Stop the Runaway MouseWhat's the "runaway mouse?" You've seen it...you... Read More
If your company has regional and worldwide operations, you might... Read More
In the early days of the personal computer, we're talking... Read More
Microsoft Great Plains and Microsoft Retail Management System (Microsoft RMS)... Read More
Having from five to ten and more favorite screensavers is... Read More
Let's say that you have a software project that's under... Read More
If you look back to the history, you will see... Read More
Microsoft Business Solutions Great Plains serves to the wide spectrum... Read More
Microsoft PowerPoint has dramatically changed the way in which academic... Read More
The Internet is reshaping every form of communications medium, and... Read More
What is Spyware?Spyware monitors your surfing habits and sends the... Read More
Microsoft Business Solutions Great Plains has several options to enable... Read More
With the advent of 'Service Pack 2' for Windows XP... Read More
Microsoft Great Plains is main Microsoft Business Solutions product, targeted... Read More
Great Plains Inventory Management (IV) module gives your business a... Read More
When you buy a computer, it most likely comes with... Read More
If you have Microsoft Great Plains and support it for... Read More
What is Tripwire?Tripwire is a form intrusion detection system (IDS)... Read More
Usually workflow & messaging is realized in CRM and then... Read More
In this small article we will be looking at the... Read More
We all take the computer for granted. I mean, all... Read More
This is intermediate level SQL scripting article for DB Administrator,... Read More
Microsoft Business Solutions Small Business Manager is scaled down Great... Read More
Microsoft Great Plains as ERP and Microsoft CRM as... Read More
We live in a post-industrial age where information is the... Read More
Looks like Microsoft Great Plains becomes more and more... Read More
RSS (Really Simple Syndication) is a way for a site... Read More
If someone entered your home, uninvited and installed numerous cameras... Read More
Microsoft Great Plains is main Microsoft Business Solutions accounting package... Read More
Anti-virus software is used to find, remove or fix files... Read More
There are many commands that are used in linux on... Read More
I've been active in the Cisco Certification track for four... Read More
The objective for Zandi Digital is to make available clever... Read More
In this short FAQ style article we would like to... Read More
Microsoft Business Solutions Great Plains was purchased from Great Plains... Read More
What is Tripwire?Tripwire is a form intrusion detection system (IDS)... Read More
If someone entered your home, uninvited and installed numerous cameras... Read More
Microsoft Business Solutions is now in process of creating so... Read More
Need software to record your voice, streaming audio or musical... Read More
It is now common thing when large corporation selects mid-market... Read More
RSS (Really Simple Syndication) is a way for a site... Read More
Have you noticed WordPerfect is gearing up for a comeback... Read More
Research bears that less than 70 percent of development projects... Read More
What is Snort?Snort is an open source network intrusion detection... Read More
Language development computer: Computer-based method for aiding language development seems... Read More
While I was preparing some personal background information for a... Read More
When you double-click a layer in the Layer Palette, you... Read More
C/SIDE (Client/Server Integrated Development Environment) - The core of... Read More
The Software 2005 conference is now a wrap. This conference,... Read More
So, why should you use any O/R mapping tool? I... Read More
This article is the third of a series of articles... Read More
We would like first emphasize the change in the paradigm.... Read More
.Net Framework is a platform or development environment to seamlessly... Read More
Microsoft Great Plains and Microsoft Retail Management System (Microsoft RMS)... Read More
Just stress testing one of the latest Linux distributions. Been... Read More
#5 All your hardware components like Printers, PCs etc come... Read More
It's not very often I get excited about a software... Read More
When you buy a computer, it most likely comes with... Read More
In our small article we'll consider Microsoft Business Solutions Great... Read More
With thousands of web pages added to the Net every... Read More
Anyone who has ever used Microsoft Word knows that it... Read More
The research in the field of Natural Language Processing usually... Read More
The adware and spyware definitions list is very long. But... Read More
Software |