Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Inheritance from custom into a base class
Message
 
À
23/01/2005 01:53:33
Information générale
Forum:
ASP.NET
Catégorie:
Conception classe
Divers
Thread ID:
00979772
Message ID:
00979776
Vues:
10
This message has been marked as the solution to the initial question of the thread.
Michel,

Can't be done. Multiple inheritance is not supported by .NET just as it isn't in VFP.

You can implement multiple interfaces, but that's not quite the same thing...

There are two ways to this however. Subclass Web Service add your error handler logic then inherit from WebServiceWithErrorHandler. Or you can use a decorator pattern and add ErrorHandleras as a separate object onto the Web Service which will give you nearly the same functinoality as multiple inheritance (but requires one extra nesting level which usually is OK)

+++ Rick ---


>Anyone found the proper way to have some inheritance based on some custom code into a base class?
>
>I have this class which starts like this:
>
>
>Public Class LXWebService
>    Inherits System.Web.Services.WebService
>    Inherits ErrorHandler
>
>
>which is a Web Service sub class but I also need to inherit from my error handler.
+++ Rick ---

West Wind Technologies
Maui, Hawaii

west-wind.com/
West Wind Message Board
Rick's Web Log
Markdown Monster
---
Making waves on the Web

Where do you want to surf today?
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform