Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Class inheritance versus Object (run-time) inheritance
Message
From
09/07/1999 14:20:47
 
General information
Forum:
Visual FoxPro
Category:
Object Oriented Programming
Miscellaneous
Thread ID:
00238626
Message ID:
00239557
Views:
13
>David,
>
>First thing is classes inherit, objects do not.
>
>The object concept you are referring to is called delegation. That is where an object delegates the responsibility for an action to some other object. The other object my its container (your word parent) or it may some other unrelated object.

Yes. Your response and the others have helped me grasp these concepts much more cleanly.

Actually, I realized after submitting the question that THISFORM was a bad example for what I was trying to ask. I see what you mean that THISFORM is a means by which an object may delegate responsibility to its container.

I see that inheritance is more like its genetic analog whereby the offspring express the characteristics of their ancestors up the family line (class hierarchy).

Still, this concept got me wondering if VFP, or OOP in general, does address the idea of inheriting from the container hierarchy rather than the class hierarchy. If I understand Vlad and Marc correctly, there is a concept called composition that embodies this abstraction, but VFP does not make use of it. Marc's comment confirmed my suspicion that composition has the advantage of utilizing the power of inheritance later in the design process (or even at run-time). But, carrying the genetic analogy to the nth degree, composition smacks a bit of the unknown can of worms we open as we learn how to manipulate the DNA of living organisms.

In practical terms, its good that VFP doesn't allow composition, since it's one less thing for me to worry about. In not so practical terms, the discussion has aroused my general curiosity enough to make me spend more time than I should talking about theory when my grindstone is demanding its due.

Thanks for taking time out from your grindstone to help educate me.
"The Iron Fish: The water is cold...but the fish don't mind"
...Jay Jenks, boyhood chum
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform