.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.
tidy up service Glenview ..You turn on your computer, and it doesn't look quite... Read More
With this small article we are continuing Microsoft Business Solutions... Read More
The first topic we are going to discuss... Read More
With the advent of 'Service Pack 2' for Windows XP... Read More
It's not very often I get excited about a software... Read More
When it comes to running an office, the SOHO entrepreneur... Read More
Viruses and spyware usually show up on your computer one... Read More
So, why should you use any O/R mapping tool? I... Read More
Microsoft SQL Server is the leader for inexpensive and middle... Read More
When you buy a computer, it most likely comes with... Read More
Spyware is software or hardware installed on a computer without... Read More
Several software companies design programs for preventive maintenance. Most of... Read More
RSS (Really Simple Syndication) is a way for a site... Read More
Microsoft CRM is now on the scene and it is... Read More
Microsoft Great Plains, Navision, Solomon and Axapta are Microsoft Business... Read More
Before September of 1995, Microsoft ignored the Internet because their... Read More
The COSMIC FP (function point) software quality metric, is no... Read More
Blue Cross and Blue Shield of Hawaii (HMSA) found itself... Read More
Combining Microsoft Business Solutions Great Plains ERP with non-Microsoft Business... Read More
Research bears that less than 70 percent of development projects... Read More
We live in a post-industrial age where information is the... Read More
According to a survey conducted by InfoTrends/CAP Ventures entitled "Content-Centric... Read More
Many reasons made GBM a unanimous choice for experts, one... Read More
How to delete the user? This is the first problem... Read More
Cyberspace has opened up a new frontier with exciting possibilities... Read More
maid service near Winnetka ..In the early days of the personal computer, we're talking... Read More
Some introduction into Great Plains Software products, now Microsoft Business... Read More
GroupwareThe internet is full of 1.5 million to 7 million... Read More
Simply put, fleet maintenance allows companies to monitor and maintain... Read More
Microsoft Great Plains fits to majority of horizontals and retail... Read More
The world of small business accounting software can be a... Read More
New post-recession era has new features, which didn't exist in... Read More
Microsoft Business Solutions Great Plains is marketed for mid-size companies... Read More
Great Plains Fixed Assets Management module is a robust tool... Read More
Microsoft CRM ? Client Relationship Management package from Microsoft Business... Read More
#5 All your hardware components like Printers, PCs etc come... Read More
The research in the field of Natural Language Processing usually... Read More
Looks like Microsoft Great Plains becomes more and more popular,... Read More
Beginning with Domino version R4 it has integration with the... Read More
When it comes to running an office, the SOHO entrepreneur... Read More
This short paper will expand on two key reasons to... Read More
"Pfishing", sometimes spelled "Phishing", is a word that's used to... Read More
This article will not attempt to advocate the use of... Read More
The objective for Zandi Digital is to make available clever... Read More
For those who still don't know, Microsoft Publisher helps computer... Read More
The Internet is reshaping every form of communications medium, and... Read More
Are you lost in the mess of documents that get... Read More
People often ask me: What image file formats will Photoshop... Read More
Microsoft Business Solutions Great Plains is marketed for mid-size companies... Read More
Security flaws have long plagued Internet Explorer (IE), the market-dominating... Read More
Software |