Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Constructor firing Inheritance in C#
Message
 
À
23/01/2006 12:45:43
Information générale
Forum:
ASP.NET
Catégorie:
Autre
Divers
Thread ID:
01088705
Message ID:
01089849
Vues:
14
Hi Bonnie,

I have a question about this.

Let me see if I can explain what I am thinking (it is not easy because I usually don't understand this things <g>) but if you need to change your parent class to make some method virtual, then you need access to that parent class source code and furthermore you are messing with all other classes that inherit this base one, shouldn't it be better if, as John expected, the overrided methods of a class were always the ones used, and only if desired you can call the base code from it? Or, on the other hand, shouldn't you always use virtual methods? (Like in Java were all methods are virtual by default)

I am not sure if I am making sense.

>Oh, that's easy John. Declare the Load eventhandler of the base form to be virtual, and then simply override it in the sub-class (you won't even need to put a delegate in the sub-class).
>
>~~Bonnie
>
"The five senses obstruct or deform the apprehension of reality."
Jorge L. Borges?

"Premature optimization is the root of all evil in programming."
Donald Knuth, repeating C. A. R. Hoare

"To die for a religion is easier than to live it absolutely"
Jorge L. Borges
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform