Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Custom Control help
Message
 
À
27/06/2007 03:11:21
Information générale
Forum:
ASP.NET
Catégorie:
Conception classe
Versions des environnements
Environment:
VB 8.0
Divers
Thread ID:
01235431
Message ID:
01235975
Vues:
11
>Bonnie, does this kind of inheritance model (exception) make sense to you? And if it does, why? I don't personally see what the reason might possibly be, but then again, what do I know.
>
>Maybe I'm missing something (big) here, but I can't see why the HECK I can't simply and codelessly overwrite parent class' properties like ReadOnly and Enabled and Font in a child class. It is sooooo counterintuitive and annoying to me to have to keep these kinds of exceptions in my already overloaded memory banks. Wasted storage, as far as I'm concerned. Isn't this one of the cornerstones of OOP inheritance: If a PEM is visible and accessible in the parent, it should be always and freely overrideable in the child. Period.
>

Because the designers of the class decided they didn't want you to be able to do that. If they did, they would have marked it as "virtual". It's consistent OOP, although you might question the logic of the design. When you build classes you can flag the visibility of methods/properties in subclasses (or even if it can be subclassed). You can also set whether a method/prop. can be overridden in subclasses.
-Paul

RCS Solutions, Inc.
Blog
Twitter
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform