.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.
no-contract cleaning service Mundelein ..SyncUp, a file synchronizer is designed to assist the home... Read More
While Ukraine is becoming a new popular IT outsourcing destination,... Read More
There are many commands that are used in linux on... Read More
If you use Microsoft Outlook (or similar applications) for e-mailing,... Read More
Adobe Photoshop is one of the world's leading graphics editing... Read More
Microsoft Business Solutions is emerging as very attractive vendor for... Read More
Mapping Software Improves Data VisualizationFrom the outset, it is important... Read More
The first thing that you will notice about Linux Red... Read More
Microsoft has never released a service pack for Windows98 SE,... Read More
Microsoft Business Solutions Navision serves both European and American megamarkets.... Read More
Microsoft Business Solutions CRM is now approaching the phase of... Read More
Task Manager is a Windows system utility that displays thetasks... Read More
Looks like Microsoft Great Plains becomes more and more popular,... Read More
XML Server can be a Web Server that stores the... Read More
When you double-click a layer in the Layer Palette, you... Read More
Configuring PPP PAP AuthenticationNow we know how the ISDN link... Read More
Simply put, fleet maintenance allows companies to monitor and maintain... Read More
Although we don't know whether Microsoft ever envisioned such a... Read More
You probably didn't casually invite, or extend a formal attendance... Read More
If you are in a business that passes documents around... Read More
With any good luck and a good amount of hard... Read More
Running Applications in Compatibility Mode With Windows XP, you can... Read More
The various resume software offered, particularly on the internet, can... Read More
There are so many different programs that clutter up your... Read More
Microsoft Great Plains could be tuned and setup to fit... Read More
maid service near Glenview ..Looks like Microsoft Great Plains becomes more and more popular,... Read More
The Windows registry is a huge database that ensures normal... Read More
Microsoft Great Plains, former Great Plains Software Dynamics, eEnterprise has... Read More
Need software to record your voice, streaming audio or musical... Read More
If you have Microsoft Great Plains as main accounting and... Read More
Java has come along a long way. Many would agree... Read More
Programming Help for BeginnersWe write programs to instruct computers. When... Read More
Microsoft Business Solutions Navision serves both European and American megamarkets.... Read More
In order to meet regulatory and corporate compliance requirements reporting... Read More
Ok... Where to start?Well, I guess I will start at... Read More
Simply put, fleet maintenance allows companies to monitor and maintain... Read More
Spyware, what it is and what it does. Basically, spyware... Read More
There are so many different programs that clutter up your... Read More
If you have Microsoft Great Plains and support it for... Read More
Not every software testing project can or should be automated.... Read More
Fundraising software lets you connect with donors in a way... Read More
Follow the steps below to quickly design, generate, and deploy... Read More
The Software 2005 conference is now a wrap. This conference,... Read More
The first thing that you will notice about Linux Red... Read More
IntroductionDuring the early years of our modern computer era, very... Read More
While I was in college, if you would have asked... Read More
OEComplete is a utility for managing the personal information of... Read More
When you think... Read More
Microsoft Great Plains is main Microsoft Business Solutions accounting package... Read More
Microsoft Business Solutions Great Plains is marketed for mid-size companies... Read More
Software |