.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 kaloyani.com - the newest kaloyani.com portal.
whole house cleaning Deerfield ..IntroductionDuring the early years of our modern computer era, very... Read More
If you are in a business that passes documents around... Read More
To all web designers out there, this article is for... Read More
ERP Consulting industry is on the way to serve clients... Read More
Once a business idea is selected, it is highly recommended... Read More
All your software is stored on a hard-drive. But how... Read More
You've finally created databases that you can actually use to... Read More
Microsoft CRM is relatively new player on the now becoming... Read More
How do you run a program on a remote server... Read More
Formatting and reinstalling windows 98 is very easy if you... Read More
DBxtra is a powerful query and reporting tool that hides... Read More
First we had the original Google search that evolved into... Read More
Blue Cross and Blue Shield of Hawaii (HMSA) found itself... Read More
Some introduction into Great Plains Software products, now Microsoft Business... Read More
I suggest that you do not spend a lot of... Read More
If you have Microsoft Great Plains and support it for... Read More
What is installation in the language of technology? Installation... Read More
It would be easy to think, like most people apparently... Read More
If you look back to the history, you will see... Read More
Sales are all about leverage, because there is only so... Read More
1. With mapping software you can create a report that... Read More
It is now common thing when large corporation selects mid-market... Read More
Microsoft Great Plains - Microsoft Business Solutions accounting and ERP... Read More
There are many commands that are used in linux on... Read More
While I was in college, if you would have asked... Read More
home cleaning services Des Plaines ..When you visit department stores and see that majority of... Read More
Usually, the easiest way to tell you have spyware is... Read More
Have you ever noticed that when you look at your... Read More
Internet worms. Is your PC infected?If your computer has become... Read More
Microsoft Great Plains ? ERM from Microsoft Business Solutions and... Read More
(1) Avoid using the same variable again and again for... Read More
A LOT OF UNWANTED FILES.When you uninstall an item of... Read More
Microsoft Business Solutions Great Plains is very good fit for... Read More
With thousands of web pages added to the Net every... Read More
If you have Microsoft Great Plains and support it... Read More
And kill the best layout software in the process of... Read More
C/SIDE (Client/Server Integrated Development Environment) - The core of... Read More
Microsoft CRM has built-in conversion tool, however you should probably... Read More
In the Clinton era the status quo was simple: you... Read More
What is Spyware?Spyware monitors your surfing habits and sends the... Read More
With so many Microsoft Windows related viruses, errors, and other... Read More
After seeing many people complain about their weak Internet security... Read More
If you have Microsoft Great Plains and support it for... Read More
Writing software manuals is boring, isn't it? We often think:... Read More
The various resume software offered, particularly on the internet, can... Read More
Microsoft Great Plains is now targeting large and midsize businesses... Read More
Manufacturing in the USA is far away down from mid... Read More
Formatting and reinstalling windows 98 is very easy if you... Read More
Trying to figure out a stream in banning one email... Read More
While several preventive maintenance software manufacturers offer free trials for... Read More
Software |