Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
If inheritance is a prime reason for OOP, then why...
Message
General information
Forum:
Visual FoxPro
Category:
Object Oriented Programming
Miscellaneous
Thread ID:
00171748
Message ID:
00171820
Views:
27
>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?

Hi, Jack

This little feature drove me crazy when I first starting using VFP3. I was used to an environment where an object inherited everything including autoamtic access to any parent code of a method or event as a default. I could not understand why my parent code was not executing. They I reread the programmer's guide.

I do not think its very intuitive. If an object inherits, it ought to inherit all of the superclass functionality without the programmer having to do anything to ensure that happens -- but...

now having said that, I have to admit that the VFP approach is a lot more flexible. I increasing like the idea that parent code can be avoided where it is not needed -- and the more I use it, the more I like it.

So, I guess its just different, and takes some getting used to if you come from another OOP environment. But once you get used to it, its pretty darn nice.

regards,
Jim Edgar
Jurix Data Corporation
jmedgar@yahoo.com

No trees were destroyed in sending this message. However, a large number of electrons were diverted from their ordinary activities and terribly inconvenienced.
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform