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:
00171853
Vues:
29
Yes, it's second nature for me also now. I simply hit the Superclass method button from Ken Levy's freebie app that also provides the Intellisense. It's just frustrating for my staff who all have less than one year's experience with VFP. First thing I ask now is if they called the parent class...

>Jack,
>
>VFP is more C++ like in terms of this. C++ was used to write VFP. In C++ if you override a method you don't get any of the inherited behavior unless you call it in the overridden code. But in VFP we always get the BaseClass behavior unless you use NODEFAULT. It would be handy if the VFP editor automatically stuck in a :: call or DoDefault() for us like Delphi apparently does. Then all you have to do is move it to the right place of execution. For me at least it's an automatic thing I do whenever editting method code.
>
>>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?
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform