Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
How To Subclass A Control
Message
De
07/04/2009 10:30:25
 
 
Information générale
Forum:
ASP.NET
Catégorie:
Code, syntaxe and commandes
Divers
Thread ID:
01392835
Message ID:
01393612
Vues:
56
>>>>>In fact you never use a base class if you can help it. You inherit not cut and paste if you want to change/modify functionality.
>>>>
>>>>This seems contradictory. Can you explain?
>>>
>>>I don't think Bernard meant you should never use base classes. I think he meant if you want to change the functionality you should inherit rather than cut and paste. (Well, duh).
>>
>>He says don't use a base class, but to inherit. What will you inherit from? Unless I am missing something that doesn't make sense at all.
>
>Maybe he had Visual FoxPro in mind. It has a very small number of base classes, most of them GUI controls. In that case it would probably make sense to inherit from each of them and work at that level. In .NET, where there are hundreds if not thousands of base classes, obviously that would be asinine.
>
>That's just speculation. I should let Bernard clarify for himself.

Actually I had both (vfp and net) in mind, but I meant the Visual (GUI) classes specifically. After all what extra functionality would you add for say the String class that is not already there and that you'd reuse?
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform