.NET :Solving the Multiple Inheritance Issue Under .NET Platform

.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.

weekly home cleaning Northbrook ...
In The News:

New research shows Americans increasingly trust AI for wellness guidance over social media, with 63% finding artificial intelligence reliable for health.
Luxury fashion brand Dior experienced a January 2025 data breach affecting customer personal information, and notifications were sent months after the discovery.
The commercial Unitree H1 humanoid robot weighs 104 pounds with 365 pound-feet torque per joint and demonstrates dangerous potential when software glitches occur.
Americans average 10-plus hours online daily, according to recent survey, splitting time between streaming shows on TV and browsing websites on multiple devices.
Boost your smartphone privacy instantly with these security tweaks for iPhone and Android that limit ad tracking, hide notifications and prevent unauthorized access.
Platforms like Hoax Tech and JS Click Cloaker help cybercriminals bypass detection systems using machine learning to selectively display scam content to victims.
A new battery recycling technique transforms old lithium-ion batteries into high-performance components that retain 88% capacity after 500 cycles with minimal waste.
Google's Android operating system can warn users about earthquakes before the shaking even begins – and there are ways to do it on your iPhone, too.
Meta's new gesture control wristband might just be the most seamless way to control a computer yet. And no, it doesn't require surgery, a camera, or even a touchscreen. All it needs is your wrist.
Long-haul trucks are now being upgraded with a surprising twist, thanks to California-based startup Revoy. Their electric boost doesn't replace diesel but works alongside it to cut emissions and fuel costs without major disruption.
PayPal and Venmo just rolled out something big: AI-powered scam alerts for Friends and Family payments.
As data centers multiply across the United States, energy demand is increasing at a rapid pace. This has not escaped the notice of large investment firms from Wall Street.
The Unicode Consortium, the nonprofit organization that maintains the Unicode Standard to ensure emojis work across devices, has announced Unicode 17.0, which includes nine new emojis slated for release this fall, in September 2025.
OpenAI is one of the world's leading AI research labs. Founded in 2015, it's behind some of today's most talked-about tools, including GPT, DALL·E, and ChatGPT.
Ever catch your dog staring at the screen during movie night and wonder if they're actually watching? Turns out, they might be. A new scientific study from Auburn University found that many dogs really do engage with television, and not all pups react the same way.
Stop the scammers from making contact in the first place. They're getting your parents' contact information and much more personal data besides, from somewhere.
The Walker S2 robot from UBTech autonomously exchanges its batteries in just three minutes, allowing continuous operation in car factories operated by BYD, Nio and Zeekr.
The FX Super One electric MPV from Faraday Future offers flexible seating, zero-gravity recliners and an AI system that creates a personal connection between driver and vehicle.
Practical solutions for reducing unwanted charity mail, political texts and email spam by opting out of shared lists, replying "STOP" and using data removal services.
Delta's new AI pricing system eliminates static airfares for personalized rates based on individual data, raising questions about fairness while promising optimized revenue.
AI data centers are straining the power grid across 13 states, contributing to a $9 billion increase in electricity costs, and PJM customers face monthly bill increases of $25 or more.
Artificial intelligence is transforming the music industry as AI-generated bands like The Velvet Sundown earn substantial streaming revenue, prompting lawsuits from major record labels.
Microsoft phishing scams use fake security alerts and links that redirect to credential-stealing pages with warning signs, including urgent language and unusual senders.
Stay up to date on the latest AI technology advancements and learn about the challenges and opportunities AI presents now and for the future.
Tesla vehicles manufactured since mid-2021 with AMD Ryzen processors can now access Grok 4, xAI's witty conversational assistant designed to make drives more engaging.

Microsoft Business Solutions Partner ? How to Launch New IT Consulting Practice

In the new era of internet marketing the problem of... Read More

Top Questions to Ask Before Buying a Help Desk & Asset Management Software

#5 All your hardware components like Printers, PCs etc come... Read More

Microsoft Great Plains Installation ? Overview for IT Director/Controller

Microsoft Great Plains is main mid-market application from Microsoft Business... Read More

Great Plains Dexterity ? Microsoft Great Plains Customization Overview

Microsoft Business Solutions Great Plains, former Great Plains Software Dynamics... Read More

Microsoft Great Plains Upgrade ? Things to Consider and FAQ

If you have Microsoft Great Plains and support it for... Read More

Did You Ever Want to Completely Erase Everything on Your Computer?

Did you ever want to erase everything on your computer?... Read More

Microsoft Great Plains: carpet, textile, fabric, felt distributor ? implementation overview

In this small article we will show you the possible... Read More

3 Reasons Why Medical Billing Software is Leading the Way

Since technology changes so quickly, it is hard to begin... Read More

The Hidden Power of Online Manual

Writing software manuals is boring, isn't it? We often think:... Read More

Microsoft Small Business Manager eCommerce ? Overview

Microsoft Business Solutions Small Business Manager is scaled down Great... Read More

Microsoft Great Plains: Offshore Customization & Development ? Overview for Consultant

When you visit department stores and see that majority of... Read More

Recovering Microsoft Great Plains Customization ? Tips for IT Director

Remember nice and prosperous Clinton era? When you implemented innovative... Read More

Behave, Word, Behave!

If you copy something from a Web site or elsewhere...... Read More

Microsoft Great Plains: Service Business Customization & Integration Example

Microsoft Business Solutions Great Plains might be considered as ERP... Read More

Brand Your Websites URL With a Favicon

Have you ever noticed that when you look at your... Read More

Microsoft CRM Data Conversion FAQ

Microsoft Business Solutions CRM data conversion deserves FAQ type of... Read More

Linux Dual Boot-How To Format

Just the thought of a duel-boot scares many people away,... Read More

Computer Phones ? Facts and Fallacies

The stakes are high when considering security, privacy, and savings,... Read More

Windows x: Basic Windows ?Security? Issues

Language development computer: Computer-based method for aiding language development seems... Read More

Recent Studies Show that 9 out of 10 PCs Are Infected with Spyware

Spyware and malware are large problems for Internet users today... Read More

Groupware and Online Collaboration: Collaboration Series #4

This article is the fourth of a series of articles... Read More

Bill of Lading ? Custom Reporting for Microsoft Great Plains ? Overview for Consultant

Bill of Lading is required report for Logistics and Freight... Read More

Why Stick With Email Clients Like Outlook?

Trying to figure out a stream in banning one email... Read More

Navision Attain C/ODBC Crystal Report ? Customization Example

Microsoft Business Solutions Navision is main ERP application for European,... Read More

Partitioning, Formatting and Reinstalling in Windows 98

Formatting and reinstalling windows 98 is very easy if you... Read More

emergency cleaning services Arlington Heights ...