.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.
![]() |
|
![]() |
|
![]() |
|
![]() |
Microsoft Business Solutions Great Plains, Navision, Axapta, Solomon and CRM... Read More
Are you a database professional? Do you work with a... Read More
Microsoft CRM was designed to be easily customizable. Microsoft CRM... Read More
As we could imagine, if you are reading this article... Read More
DBxtra goes ASPGetting to the information hidden within corporate databases... Read More
Remember old good days when your company probably had Great... Read More
Just when you thought you were Web savvy, one more... Read More
Many reasons made GBM a unanimous choice for experts, one... Read More
When it comes to running an office, the SOHO entrepreneur... Read More
This article is the first of a series of articles... Read More
Looks like Microsoft Great Plains becomes more and more popular,... Read More
If you have Microsoft Great Plains as main accounting and... Read More
And kill the best layout software in the process of... Read More
The vast majority of us will have, at some point,... Read More
With any good luck and a good amount of hard... Read More
Words we choose to describe things and phenomena often show... Read More
Need software to record your voice, streaming audio or musical... Read More
The fact that a software tester is a most infamous... Read More
In the early days of the personal computer, we're talking... Read More
Language development computer: Computer-based method for aiding language development seems... Read More
Intro This concise article will tell you in plain English... Read More
One of the things we can be as certain of... Read More
You might think you don't need a firewall... Read More
Let's first look at your ERP system selection (without Retail... Read More
There are so many different programs that clutter up your... Read More
You have gotten those E_Mails buy software at deep discounts.... Read More
Microsoft Business Solutions Great Plains is very popular ERP platform... Read More
Creating a new markup language.Introduction.General Reuse Markup Langauge, or GRML,... Read More
If you are to buy a HelpDesk & Asset Management... Read More
Microsoft Business Solutions Great Plains version 8.5, 8.0, 7.5, Great... Read More
Each Industry and market niche has business specific and unique... Read More
When it comes to screenplay software each screenwriter needs to... Read More
Just stress testing one of the latest Linux distributions. Been... Read More
In the previous ISDN article, we looked at how and... Read More
So let's begin crunching down these 300 images using Adobe... Read More
The US House of Representatives has recently passed the "Spy... Read More
Microsoft Business Solutions Great Plains is marketed for mid-size companies... Read More
Microsoft Business Solutions Great Plains, former Great Plains Software eEnterprise,... Read More
If there still are few unprotected computers left, I haven't... Read More
I've been active in the Cisco Certification track for four... Read More
Microsoft Great Plains may be recommended for international freight forwarding... Read More
C/SIDE (Client/Server Integrated Development Environment) - The core of... Read More
Before September of 1995, Microsoft ignored the Internet because their... Read More
It's all about turn times in the eMedia industry! The... Read More
Microsoft Great Plains is main accounting / ERP application... Read More
Many reasons made GBM a unanimous choice for experts, one... Read More
Linux essentials:It's free for download but you have to pay... Read More
Enabling Chinese input is quick and easy, there are only... Read More
Microsoft CRM is relatively new player on the now becoming... Read More
Microsoft Business Solutions is now in process of creating so... Read More
When you buy a computer, it most likely comes with... Read More
Although we don't know whether Microsoft ever envisioned such a... Read More
What is Interactive Mapping?Interactive mapping is a visual display medium... Read More
1. What determines the software price? Is it Per Seat... Read More
Customer Relationship Management (CRM) is a strategy and processes used... Read More
OEComplete is a utility for managing the personal information of... Read More
Spyware is like the new technological nuclear weapon on the... Read More
If you have Microsoft Great Plains and support it for... Read More
Hey Guys! Don't raise your eyebrows or fear by hearing... Read More
Innovative Maintenance Systems (IMS) is one company that offers solutions... Read More
Microsoft CRM is winning market share step-by-step from such the... Read More
For those who still don't know, Microsoft Publisher helps computer... Read More
Document Management or Enterprise Information Management is perhaps one of... Read More
Let's say that you have a software project that's under... Read More
Creating a new markup language.Introduction.General Reuse Markup Langauge, or GRML,... Read More
You have gotten those E_Mails buy software at deep discounts.... Read More
Software |