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: Unable to open RSS Feed $XMLfilename with error HTTP ERROR: 404, exiting |
RELATED ARTICLES
Groupware: Avoid the Ad Hoc Shuffle GroupwareEfforts are continually made to manage the unavoidable ad hoc business process, but ad hoc processes do not necessarily mean a pile of messy, shuffled documents, at least not anymore. Groupware is software which tracks and manages the ad hoc business collaboration. What is Spyware? Are You Being Watched? Find out why Spyware Removal from computers is important and how adware infestations affect your computer, your privacy and your family.Internet users worldwide spend several hours to several days each week browsing or searching the net. Reporting Tools for Microsoft Great Plains - Overview For Developers Looks like Microsoft Great Plains becomes more and more popular, partly because of Microsoft muscles behind it. Now it is targeted to the whole spectrum of horizontal and vertical market clientele. Most Dangerous Types of Spyware are on the Rise: How to Choose the Weapon Bad News - the Threat is Bigger than it SeemedHow recently it was - when even many journalists thought that spyware gathers mostly information to be used for targeted advertising. Definitions like "spyware, a. What to Do if All Screensavers Fun is Grayed Out? Finally, you have some time to personalize your desktop with an interesting screensaver. But wait. Ukraine: a Prospective Player on the World Software Outsourcing Market The destruction of the Soviet Union about 15 years ago, made a huge country with a great level of IT science divided into small bricks. Nowadays, despite Russia's expansion into the world software development market, Ukraine keeps playing an important role here too. Exactly What Does FTP Stand for and What Can it do for Me? FTP stands for "file transfer protocol". FTP is basically a way of sending files over the Internet. Linux Secrets The first thing that you will notice about Linux Red Hat (using the Gnome Interface) is that it looks a lot like Windows 95/98/NT. But that's where the similarity ends. Microsoft Great Plains Multicurrency - Overview For Implementation Consultant When you first think about multicurrency - you probably have in mind the revaluation question. Currency triangulation - which was the need when European currencies were fixed to Euro is not an issue any more. Microsoft Great Plains - Microsoft RMS Integration - overview Microsoft Great Plains and Microsoft Retail Management System (Microsoft RMS) are originally developed by different software vendors, who had no idea that in the remote future (now) these two applications will be owned by Microsoft and will need to be tightly integrated. Current integration between the two is not an easy thing. Microsoft Great Plains Subcontracting - Overview for Microsoft Business Solutions Partner Microsoft Business Solutions Great Plains is very popular ERP/MRP applications in the USA, Canada, UK, Australia, New Zealand, Middle East, South Africa, Latin America. Considering high number of new Microsoft Great Plains partners and the desire to subcontract occasional customization, integration and reporting projects, we would like to advise you on Microsoft Great Plains subcontracting guidelines, based on our experience in dealing with Great Plains VARsCandidates for subcontracting:? Great Plains Dexterity customizations - Dexterity was and still is the IDE and programming language of Great Plains, especially workstation thick interface. Groupware as a Document Manager: Collaboration Series #3 This article is the third of a series of articles exploring specific aspects of groupware. The brief informational articles in this series discuss some of the technologies associated with groupware, as well as some of the characteristics of groupware. Microsoft CRM Customization - Processing In/Out-Going Email Messages We would like to give you several situations, when you may need custom development and programming to improve Microsoft CRM functionality. This overview is for programmer, software developer, IT specialist, database administrator. The Truth: Netzero 3G We've all seen the ads on TV for Netzero 3G. You know the ones, "speeds so fast you sworn it was broadband" Well if your using it, you may not think it really is. 10 Programming Tips (1) Avoid using the same variable again and again for different purposes.This happens with us that we think that more and more memory will be wasted if we declare seperate variable for each purpose. Causes of ERP Failures ERP is the acronym of Enterprise Resource Planning. Multi-module ERP software integrates business activities across various functional departments, from product planning, parts purchasing, inventory control, product distribution, to order tracking. Microsoft CRM Data Import FAQ Microsoft CRM has built-in conversion tool, however you should probably first try third party conversion tool, such as Scribe. It is relatively expensive and has bunch of importing capabilities, that you might never use and need. Builders Beware Which Type of Shop Can Rely On A Home Built System?Not all shops are at a disadvantage when it comes to building their own system. To determine which avenue a shop should take, owners must know what type of shops benefit from a self built solution and what type is better off purchasing one. Examining the Substance of Studio MX To all web designers out there, this article is for you! I guess you already heard about Studio MX (I think so!) - the ideal bundle for professional web designers, bringing together Dreamweaver MX for page design, Flash MX for animation and interactivity, and Fireworks MX for editing and optimizing graphics. With all these components, it certainly provides professional functionality for every aspect of web development. Perfectly New Database Query Tool - Foxy SQL Pro Released Are you a database professional? Do you work with a lot of databases? Do you use an SQL code? Do you want to connect to a new database to physically create its structure in no time and with ease? Are you tired of having to handle several client applications?If your answer is "yes" to any of these questions, I recommend you to go on reading this article.Let's imagine you work with let's say three databases. |
home | site map | contact us |