Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Class inheritance versus Object (run-time) inheritance
Message
 
To
07/07/1999 20:14:24
General information
Forum:
Visual FoxPro
Category:
Object Oriented Programming
Miscellaneous
Thread ID:
00238626
Message ID:
00239376
Views:
15
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.

The term inheritance means that a sub class HAS the behavior of its superclass, it doesn't call the superclass for that behavior. One actual definition of inheritance is, "The ability of one class to obtain all or part of its definition from another class." In your object example the contained (child) object does not have the behavior in question, instead it is delegating to the container object which has the behavior.
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform