.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.
quick home cleaning Glenview ..Spyware and malware are large problems for Internet users today... Read More
Are you ready? SQL Server 2005, the next-generation data management... Read More
Microsoft CRM ? Client Relationship Management package from Microsoft Business... Read More
Microsoft Business Solutions Great Plains is very generic accounting application... Read More
IBM Lotus Notes with Domino email server is traditional document... Read More
We live in a post-industrial age where information is the... Read More
In a previous article, I wrote about OpenOffice... Read More
So, why should you use any O/R mapping tool? I... Read More
Microsoft PowerPoint has dramatically changed the way in which academic... Read More
If you company is small or mid-size special products or... Read More
Microsoft Great Plains has substantial mid-market share in the USA... Read More
Microsoft Business Solutions main middle market ERP application - Microsoft... Read More
Task Manager is a Windows system utility that displays thetasks... Read More
Fleet Maintenance Management is a critical position in any company... Read More
Microsoft Business Solutions CRM data conversion deserves FAQ type of... Read More
Microsoft Business Solutions Great Plains has substantial market share among... Read More
Navision Software was purchased by Microsoft and now it is... Read More
Music downloads are off the charts! We're listening to digital... Read More
Language development computer: Computer-based method for aiding language development seems... Read More
Microsoft released Service Pack 2 (SP2) for the Windows XP... Read More
There are many commands that are used in linux on... Read More
In the real world a "fire wall" is a fireproof... Read More
Programming Help for BeginnersWe write programs to instruct computers. When... Read More
As seeing large number of implementations ? in our case... Read More
There are so many different programs that clutter up your... Read More
scheduled maid service Winnetka ..With the advent of 'Service Pack 2' for Windows XP... Read More
In the case when you represent mid-size or mid-size-to-large business,... Read More
Microsoft Great Plains is one of the Microsoft Business Solutions... Read More
RSS (Really Simple Syndication) is a way for a site... Read More
Microsoft Great Plains fits to majority of industries, in the... Read More
GroupwareEfforts are continually made to manage the unavoidable ad hoc... Read More
Microsoft Great Plains is main Microsoft Business Solutions accounting package... Read More
You have gotten those E_Mails buy software at deep discounts.... Read More
Once upon a time not so long ago, there was... Read More
We'll give you non formal view, based on our consulting... Read More
Microsoft CRM is CRM answer from Microsoft and attempt to... Read More
Microsoft Retail Management (RMS) and Microsoft Great Plains are retail... Read More
In the real world a "fire wall" is a fireproof... Read More
There are certain pluses and minuses in both cases and... Read More
An integral part of any quality CRM system is lead... Read More
What is RAID RECOVERY?RAID stands for Redundant Array of Inexpensive... Read More
"Pfishing", sometimes spelled "Phishing", is a word that's used to... Read More
IntroductionDuring the early years of our modern computer era, very... Read More
Great Plains Fixed Assets Management module is a robust tool... Read More
Microsoft Great Plains, former Great Plains Software Dynamics, eEnterprise has... Read More
DBxtra is a powerful query and reporting tool that hides... Read More
Microsoft Business Solutions CRM is now approaching the phase of... Read More
The first thing that you will notice about Linux Red... Read More
Imagine something that follows you home and sets itself up... Read More
Each Industry and market niche has business specific and unique... Read More
Software |