Software Information

.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 VBprofs.com - the newest Visual Basic and VB.NET resources portal.


MORE RESOURCES:

USA TODAY

Oracle Broadens Reach in Web-Based Software
Wall Street Journal
By BEN WORTHEN Oracle Corp. agreed to acquire online-software maker Taleo Corp. for $1.9 billion, its second such acquisition in recent months and the latest sign that the software industry's old guard is embracing a newer model.
Oracle Will Purchase Taleo for $46 a Share in Deal Valued at $1.9 BillionBloomberg
Oracle Embraces the Cloud With $1.9 Billion Taleo DealNew York Times
Oracle paying $1.9 billion for Taleo's HR softwareSan Francisco Chronicle
Forbes -San Jose Mercury News
all 450 news articles »


Tableau Software Positioned as "Challenger" in Leading Analyst Firm Magic ...
San Francisco Chronicle (press release)
Tableau® Software, the global leader in rapid-fire business intelligence software, today announced that Gartner, Inc. has positioned Tableau as a "Challenger" in its 2012 Magic Quadrant for Business Intelligence Platforms* report.
Information Builders Ranked as a Leader in Analyst Firm's Magic Quadrant for ...MarketWatch (press release)

all 68 news articles »


GrayHair Software releases a dynamic reporting engine to complement its cloud ...
EON: Enhanced Online News (press release)
MOUNT LAUREL, NJ--(EON: Enhanced Online News)--GrayHair Software, Inc., a leader in solutions for business mailers, announces the release of a ground-breaking reporting engine that expands the versatility and depth of the services offered in its ...

and more »


ND software <3794.OS>-2011/12 parent forecast
Reuters
Feb 10 (Reuters) - ND SOFTWARE CO LTD PARENT-ONLY EARNINGS ESTIMATES (in billions of yen unless specified) Full year to Full year to March 31,2012 March 31,2012 LATEST PREVIOUS FORECAST FORECAST Sales 5.68 5.17 Recurring 1.87 1.42 Net 997 mln 847 mln ...

and more »


Software Developers Get SaaS-y with Expanded Software-as-a-Service Platform
EON: Enhanced Online News (press release)
The software distribution platform allows software publishers to put their applications immediately in the cloud as a Software-as-a-Service (SaaS) offering with no development or rewrite effort. “Porting and conversion costs have been eliminated, ...

and more »


Software maker Nuance shares plunge on 1Q miss
CBS News
Software maker Nuance Communications Inc. reported late Thursday that its first-quarter net income rose as revenue climbed for its health care, mobile and imaging applications, but its adjusted earnings and revenue fell short of analysts' expectations ...
Nuance Blunt In Earnings MissInvestor's Business Daily

all 31 news articles »


Home Media Magazine

Video-Game Retail Sales in US Slid 34% in January, NPD Reports
BusinessWeek
9 (Bloomberg) -- US retail sales of video-game hardware, software and accessories tumbled 34 percent in January to $750.6 million from a year earlier, researcher NPD Group Inc. said today in an e-mailed statement. Sales a year ago were $1.14 billion, ...
Videogame Sales Plunge 34 Percent in JanuaryPC Magazine
US video game sales fall 34 percent in January due to lack of new titlesWashington Post
January NPD: Sales down without big launches, Skylanders a hit for accessoriesJoystiq

all 109 news articles »


Callidus Software Increases Sales but Misses Estimates on Earnings
DailyFinance
By Seth Jayson, The Motley Fool Posted 11:19AM 02/09/12 Investing Callidus Software (NAS: CALD) reported earnings on Feb. 8. Here are the numbers you need to know. For the quarter ended Dec. 31 (Q4), Callidus Software beat slightly on revenues and ...
Callidus Software to Participate in Upcoming Investor ConferencesMarketWatch (press release)
Callidus Software Slips To Wider Q4 LossNASDAQ
Callidus Software Announces Fourth Quarter and Full Year 2011 ResultsMarketwire (press release)

all 27 news articles »


Raytheon Releases Software Upgrade for Airborne Communication System
MarketWatch (press release)
The enhancement is provided by an upgrade to Integrated Waveform (IW) software, following successful field tests hosted by the Defense Information Systems Agency (DISA). Prior to the software upgrade, this form of radio communications had limited ...

and more »


Quest Software Earnings Preview
DailyFinance
By Motley Fool Staff Posted 1:34PM 02/09/12 Investing Quest Software (NAS: QSFT) hasn't been able to establish an earnings trend, bouncing between beating and falling short of estimates during the past fiscal year. The company will unveil its latest ...

and more »

Google News

Home | Site Map

Powered By: Free Work At Home Business Opportunity!

© 2006