Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
If inheritance is a prime reason for OOP, then why...
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Programmation Orientée Object
Divers
Thread ID:
00171748
Message ID:
00171792
Vues:
36
>>>Why does VFP override the methods by default? In a team environment, this can cause many problems. Eventually everyone will execute our macro to "DODEFAULT()" when adding code to methods of our classes without having to think about it.
>>>
>>>As one adds code to a class in Delphi, it automatically adds a INHERIT keyword. The developer must make a conscious effort to override the parent class code. Doesn't this make more sense? If the purpose of developing classes is for code re-use and inheritance, then VFP should not override by default. This would also be useful when using third party classes...
>>>
>>>Is this reasonable, or is there a method to this madness?
>>
>>It was designed that way so you wouldn't have to think about it. DODEFAULT() and the Scope Resolution Operator (::) are provided to access parent code.
>>
>>Subclassing objects targets more the reuse of the entire class rather than just method code.
>>
>>Dave
>
>If you should by chance meet Anders Hejlsberg (lead architect of Delphi through 3.0) on the MS campus, could you ask him why Object Pascal defaults to the INHERIT keyword? Do the class wizards in VC++ behave the same as VFP in that one overrides the parent class by default?
>
>This is more an interest in the theory and reasoning in the different approaches... Thanks for the response and insight from insider's perspective.
>
>Regards,
>
>Jack Mendenhall
>Reinsurance Management, Inc.

You're welcome. Let me get back to you after the New Year. Anders is just one floor below me.

Dave
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform