![]() |
Easy Information For you | |
|
|
.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: » |
RELATED ARTICLES
Microsoft Great Plains Upgrade - Version 8.0 Overview for IT Director/Controller If you have Microsoft Great Plains as main accounting and ERP system you need to know some technical details on Great Plains version upgrade and what is going on behind the scenes, which options do you have in case of Dexterity, VBA, SQL customizations, ctree/Pervasive migration to MS SQL/MSDE. As of right now it is reasonable to upgrade to Microsoft Great Plains 8. Monitoring Software Can be Used for Spying as Well We all already got used to computer monitoring both at work and at home. We got used to advertising monitoring software products as tools for parental control and workplace surveillance. Internet Security Threats: Who Can Read Your Email? Before being able to choose a secure Internet communication system, you need to understand the threats to your security.Since the beginning of the Internet there has been a naive assumption on the part of most email users that the only people who are reading their email are the people they are sending it to. Importance of Coding Standards Programming Help for BeginnersWe write programs to instruct computers. When programming using a high level programming language like C++ or Java, we are using a syntax that is somewhat closer to human languages. Introduction To ISDN, Part II In the previous ISDN article, we looked at how and why one router dials another using ISDN. Just as important is knowing what keeps the link up once it is dialed. Groupware: What Works the Way Businesses Do? GroupwareThe internet is full of 1.5 million to 7 million indexed pages of groupware packages available on the market today. Corporate ERP: Standard vs. Rich functionality - Microsoft Great Plains Traditionally we were considering functionally rich systems, such as SAP, Oracle Financials, PeopleSoft, JDEdwards as the fit for large publicly traded corporation. There might be multiple opinions for the future corporate ERP/MRP systems. The Tools and Features of Adobe Photoshop Adobe Photoshop is one of the world's leading graphics editing programs, developed by Adobe Systems. Available on Mac OS or PC, Photoshop is used as one of the leading image design programs for the World Wide Web. S is for Spying, Surveillance -- and for Software as Well Words we choose to describe things and phenomena often show our attitude towards what we say. They imperceptibly reflect our opinions and judgments, prejudices and preferences, moral convictions and beliefs. Business Plan Software Review: Ultimate Business Planner? One of the main reasons business owners and entrepreneurs use business plan software is to simplify building their financial models. Even with an explosion in business plan software packages on the market today, "doing the financial projections" is still often cited as the most difficult part of completing a business plan. Software Review: Xsitepro Total Site Management Software It's not very often I get excited about a software program, but today I'm so excited I just had to tell you about Xsitepro, the top tool for Internet marketers. In particular, those who have been using HTML applications programs like Dreamweaver and Frontpage to produce their Internet media will find this program revolutionary in that it can at least halve your time for site development. Configure Windows Indexing Service for Performance The Windows Indexing Service provides you with the ability to perform advanced searches on directories located on your computer and on shared directories on the network. The Indexing Service was introduced with IIS (Internet Information Services) and is now installed with Windows 2000 and Windows XP. Microsoft Great Plains Reporting - Overview for Developer 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. Healthcare Preventive Maintenance Software Healthcare facilities such as clinics, hospitals, and biomedical laboratories can benefit greatly if up to date CMMS software is used. Healthcare CMMS programs will help with the maintenance of the building, alerting workers when items such as automatic doors, light fixtures, and plumbing structures are due for checkups. SQL Administrator Skills Required to Support Microsoft Great Plains Microsoft Great Plains is becoming more and more popular and we see new purchases among midsize and large corporations, where, in our opinion, Microsoft SQL Server DB administrator position is a must. If you are database administrator and you are part of the decision making team, purchasing Microsoft Business Solutions Great Plains for your corporation, we would like to set your expectation on the level of SQL knowledge, skills and experience needed to support Microsoft Great Plains in-house? Data querying. Great Plains Custom Development: Dexterity, VBA, SQL, Crystal, eConnect - Overview For Programmer Microsoft Great Plains is main Microsoft Business Solutions accounting package for the US market. It has multiple customization/modification/reporting tools. 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. Four Desktop Tools To Drastically Increase Your Productivity Sticky Noteshttp://www.deprice. Microsoft CRM Customization: Integration with Third Party SQL Application/Database Microsoft CRM - Client Relationship Management package from Microsoft Business Solutions was initially designed to be customizable with Microsoft Visual Studio.Net and one of its programming languages - C#. Software Upgrades Arent Always the Best Move When my daughter was getting into AOL instant messaging (AIM) and using all the cool add-ons, I looked for more as it's a great way to learn about extending applications. While doing research, I learned that if you wanted to use AIM themes, you don't want to upgrade to AIM 5. |
|
home | site map | Free Forum Host | Forums |
| © 2007 - 2008 |