.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.
affordable house cleaning Wilmette ..Microsoft has never released a service pack for Windows98 SE,... Read More
What is installation in the language of technology? Installation... Read More
Midsize business or non-profit organization should decide if one-vendor solution... Read More
There are several kinds of software piracy. The bottom line... Read More
This article is the third of a series of articles... Read More
2005 ? Back to the Future.What does the future hold?... Read More
This article is the fourth of a series of articles... Read More
Microsoft Business Solutions CRM is present several years on the... Read More
In this small article we will show you the possible... Read More
Need help making sense of algebra? Have algebra lectures in... Read More
Microsoft Great Plains as ERP and Microsoft CRM as... Read More
The intentions of this short tutorial are not to teach... Read More
It is a well known fact that Java as a... Read More
I like my software simple. If it's too complex or... Read More
Just stress testing one of the latest Linux distributions. Been... Read More
Before September 1995, Microsoft Windows was an MS-DOS program. DOS... Read More
You turn on your computer, and it doesn't look quite... Read More
Microsoft Great Plains could be tuned and setup to fit... Read More
Background: For many organizations like ours, the interim target of... Read More
With so many Microsoft Windows related viruses, errors, and other... Read More
Crystal Reports is the most flexible tool on the market... Read More
Microsoft Great Plains is becoming more and more popular and... Read More
Document Manager and Version HistoryIn previous articles I have discussed... Read More
As Mozilla Firefox nears 10% market share, with well over... Read More
Have you ever noticed that when you look at your... Read More
quick home cleaning Northbrook ..Microsoft Great Plains - Microsoft Business Solutions accounting and ERP... Read More
If someone entered your home, uninvited and installed numerous cameras... Read More
This article is the third of a series of articles... Read More
If you company is small or mid-size special products or... Read More
Microsoft Great Plains as ERP and Microsoft CRM as... Read More
In this small article we will be looking at the... Read More
I provide, here clear explanations and a count of function... Read More
SyncUp, a file synchronizer is designed to assist the home... Read More
DBxtra goes ASPGetting to the information hidden within corporate databases... Read More
Since its release in 1987, QuarkXpress had made an immediate... Read More
Whether you are a small consultancy firm, a medium sized... Read More
Fortunately one of the most common reasons cited for the... Read More
This is intermediate level SQL scripting article for DB Administrator,... Read More
Logistics automation is often considered as barcoding extension to Sales... Read More
Pirated software is on the increase and now accounts for... Read More
We would like to give you pluses and minuses of... Read More
The Microsoft system preparation utility for Windows 2000 is a... Read More
We'll give you non formal view, based on our consulting... Read More
If you have been using the Internet for any amount... Read More
Customer Relationship Management, abbreviated "CRM," is the term for a... Read More
In this short FAQ style article we would like to... Read More
Looks like Microsoft Great Plains becomes more and more popular,... Read More
Mike Dunville* had a decision to make. As the new... Read More
And kill the best layout software in the process of... Read More
Most computer users use spreadsheets software such as Microsoft Excel... Read More
Software |