Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
If inheritance is a prime reason for OOP, then why...
Message
From
31/12/1998 13:44:09
 
General information
Forum:
Visual FoxPro
Category:
Object Oriented Programming
Miscellaneous
Thread ID:
00171748
Message ID:
00171960
Views:
30
>Jim,
>
>>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...
>
>The way it is in VFP and C++, although a pain to code and sometimes forgotten, is much more controlled because the inherited code can be called at the beginning, middle or end of the overridden code. Which in some cases is very desireable to have this flexibility. I'd say on the average I call the inherited code at the top 85% of the time, in the 5% and the bottom 10%.
>
>>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.
>
>If you find yourself not calling the ParentClass code from an overridden method it may point to a design problem of the class.

Hi David,

Actually most of my abstract objects are designed sparsely with just s skeleton to be filled in by derived objects. But I have to confess that since I discovered the flexibility of VFP's superclass method calling, I have included method code that is intended to be skipped much of the time -- just because I don't like to cut and paste. Its easier just to default to the desired functionality if I want it. I don't think this is bad design. But if it is, I'm going to keep doing it anyway. It works pretty well.

Have a happy New Year

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
Reply
Map
View

Click here to load this message in the networking platform