.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.
recurring cleaning service Mundelein ..This tutorial covers OLAP solutions used by Data warehouses and... Read More
I have yet to see a business that, sometimes in... Read More
Great Plains Accounting, accounting package for mid-size and small companies... Read More
Should one use Windows Update?This topic has good and valid... Read More
Handling character strings in Java is supported through two final... Read More
You might think you don't need a firewall... Read More
Microsoft CRM ? Client Relationship Management package from Microsoft Business... Read More
Spyware is software or hardware installed on a computer without... Read More
Do you want to get quality software at a reasonable... Read More
Enabling Chinese input is quick and easy, there are only... Read More
All of us know that Microsoft bought former Great Plains... Read More
Microsoft Business Solutions ? Great Plains has captured the US... Read More
Fortunately one of the most common reasons cited for the... Read More
Microsoft Business Solutions Great Plains has Project Accounting module where... Read More
Microsoft Great Plains is main Microsoft Business Solutions accounting package... Read More
I have always regretted how Microsoft price gouges and rips... Read More
Sometimes your PC will start acting strange for no apparent... Read More
What is IRC?IRC is Internet Relay Chat. It is a... Read More
Whether you have used Microsoft Word for years, have just... Read More
In order to implement VLANs in a network environment, you'll... Read More
Microsoft PowerPoint has dramatically changed the way in which academic... Read More
Programming Help for BeginnersWe write programs to instruct computers. When... Read More
While I was in college, if you would have asked... Read More
Small can be beautiful! Working with Knoppix for the past... Read More
When you visit department stores and see that majority of... Read More
tidy up service Buffalo Grove ..Microsoft Business Solutions CRM is now approaching the phase of... Read More
People often ask me: What image file formats will Photoshop... Read More
It is now common thing when large corporation selects mid-market... Read More
Once a business idea is selected, it is highly recommended... Read More
When making a decision to buy any piece of software... Read More
"Pfishing", sometimes spelled "Phishing", is a word that's used to... Read More
Table of Contents1) Introduction 2) Related Work 3) Framework 4)... Read More
Using professional icons in your application or website can bring... Read More
If someone entered your home, uninvited and installed numerous cameras... Read More
With the advent of 'Service Pack 2' for Windows XP... Read More
Anyone who has ever used Microsoft Word knows that it... Read More
If you have been using the Internet for any amount... Read More
Hey Guys! Don't raise your eyebrows or fear by hearing... Read More
You would like to protect your documents, wouldn't you? Reasons... Read More
The Software 2005 conference is now a wrap. This conference,... Read More
Looks like Microsoft Great Plains becomes more and more popular,... Read More
DBxtra goes ASPGetting to the information hidden within corporate databases... Read More
OEComplete is a utility for managing the personal information of... Read More
All of us know that Microsoft bought former Great Plains... Read More
Let us give you - developer some hints in the... Read More
We would like first emphasize the change in the paradigm.... Read More
Should one use Windows Update?This topic has good and valid... Read More
Not every software testing project can or should be automated.... Read More
With any good luck and a good amount of hard... Read More
Finding the best spyware removers to detect and remove spyware... Read More
Software |