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.
|
RELATED ARTICLES
Microsoft Great Plains Logistics & Warehouse Management ? Implementation & Customization Highlights Logistics automation is often considered as barcoding extension to Sales Order Processing, Purchase Order Processing, Inventory Control modules. Software extensions makers may disagree with this simplification, but budget solution works exactly like barcoding extension and is usually done via Great Plains Dexterity, Modifier with VBA and SQL stored procedures. If your company is looking for implementing automated inventory bin/item pickup and conveyer ? then you need specialized software. However if you just envision your warehouse workers with barcode scanners ? then read this article to understand your options with Microsoft Business Solutions Great Plains. Most Dangerous Types of Spyware are on the Rise: How to Choose the Weapon Bad News - the Threat is Bigger than it Seemed Create A Flash Presentation For Free With Open Office The intentions of this short tutorial are not to teach you how to use Open Office, but rather to show you a quick and dirty way to create presentations and tutorials that can be exported as a Macromedai Flash file. Running a Program on a Remote Server Using SSH How do you run a program on a remote server using ssh? Protect Your Computer...and Your Business! We all take the computer for granted. I mean, all we have to do is switch it on and it's ready to go. But did you ever stop to think what would happen if your computer suddenly crashed? And that is the only computer you have to work on! Ukraine IT Myths Dispersed While Ukraine is becoming a new popular IT outsourcing destination, there are still many myths about it and no clear understanding of the opportunities outsourcing to Ukraine can present. Let us look closely at some of those myths and find out whether there is any truth behind them. Microsoft CRM Implementation for Large Corporation ? overview Microsoft Business Solutions CRM is now approaching the phase of being mature product and the CRM solution you may consider for large publicly traded company. Our view point considers the fact of multiple platforms and systems coexistence and balancing: UNIX, Linux, Microsoft Windows, Java, .Net, PC, AS/400, RS6000, Microsoft Exchange, Lotus Notes Domino, etc. This increases the cost of maintenance, but decreases the risk of being trapped to one vendor/solution. So far we've seen successful implementations of Microsoft CRM in the following industries: Distribution, Logistics, Non-Profit, Chemicals, Pharmaceutical, Placement/Recruiting, Medicare/Hospitals, Retail, Wholesale, Education, Beverages, Services, Defense, Aerospace, Oil & Gas. Google Brings the Earth to Your Desktop Google Inc. has launched a new software package that allows you to see satellite images on your desktop. Lotus Domino Implementation and Development: Infrastructure ? Present and Future Domino server is a buffer between the operation system and the application. On the other hand Domino server ? consists of the services which support development processing and executing of dynamic, secure applications for Internet, Intranet, or Extranet. Domino server role is to provide functionality both: within and between Domino-applications. Domino services interpret codes and elements of application and execute them over actual operation system. Each service is specially optimized for its specific role when Domino is activated for effective functioning of the whole application. Free Preventive Maintenance Software While several preventive maintenance software manufacturers offer free trials for their products before charging a fee, some companies offer their products for free. Free preventive maintenance software is rare, and is sometimes less thorough than software that must be purchased, but it can be a good solution for a new or struggling business. Lotus Notes Domino and Web: Application Development ? Tips for Programmers Beginning with Domino version R4 it has integration with the Web, and the server itself becomes a HTTP-server. The next releases of Domino Web-server add new functionality (for example servlet managers, supported JVM versions upgrade, etc). To give you general picture and abstracting from details we'll talk about two major Domino Web-server functions: What is a Document Manager without Version History? Document Manager and Version History Industry Experts Answer the One Million-dollar Question - Why Genie Backup Manager? Many reasons made GBM a unanimous choice for experts, one of them is the fact that with the set of features it offers, it's definitely the easiest to use. 25 Things Mapping Software Can Do For You 1. With mapping software you can create a report that tracks your retirement plan for you. Microsoft Navision Customization and Reporting ? Tips For Programmer/IT Specialist C/SIDE (Client/Server Integrated Development Environment) - The core of Navision is the C/SIDE. C/SIDE is the foundation for all the business management functionality of Navision. It is made up of five building blocks, called object types, which are used to create the application. These five object types are shared throughout Navision to create every application area, and give it a unified, consistent interface. This powerful language allows for the internal construction of new business logic and sophisticated reporting. Because of the internal nature of modifications it's highly recommended that you develop all your code in "processing only" report objects and called from the native code base. By grouping all your code in logical units, upgrades and additional modifications are easier to manage. 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. Adware and Spyware Blockers The most important things you can do for your computer right now is to install adware and spyware blockers. Everyone is aware of computer viruses and run an anti-virus program to guard your computer against them. Fleet Maintenance Software Reviews Innovative Maintenance Systems (IMS) is one company that offers solutions for companies in need of fleet maintenance software. One of their most popular products is Fleet Maintenance Pro�. According to the website and fleet maintenance software reviews, this product offers automatic calculations of maintenance, assists in tracking PM and repair maintenance, helps you analyze fleet costs over time and much more. This product is recommended for maintaining vehicles that are tracked by date, mileage, hours and etc. Prices range from $189.00 - $750.00 for single users, but networking capabilities are also available. 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 Defining OLAP Solutions and Data Warehouse design This tutorial covers OLAP solutions used by Data warehouses and understanding Data Warehouse design. The enterprise needs to ask itself certain fundamental questions before actually launching on the process of designing the data warehouse. It must begin with a conviction that a data warehouse would really help its business and the return on investment will make it worth it. |
home | site map |
© 2005 |