Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Class inheritance versus Object (run-time) inheritance
Message
From
09/07/1999 20:01:38
 
General information
Forum:
Visual FoxPro
Category:
Object Oriented Programming
Miscellaneous
Thread ID:
00238626
Message ID:
00239720
Views:
20
>David,
>
>Composition is not an inheritance. Composition only means to assemble multiple classes into one calss using containership (or ownership where one class owns the other classes).

So composition is what happens when I build a Form which contains a typical complement of controls and then I save it as a class ?

Now that I know that composition is not what I thought it was, it still leaves my original question open as to whether generalized OOP considers the concept of inheritance through containership rather than through class. At first blush, it seems like it would really be powerful to be able to do this, although I understand that it creates all sorts of new problems and conflicts with conventional class inheritance.

The reason this question arose in my mind is because I realized, after creating my first form (which was the one you coached me on, BTW) that I wanted every control in the form to use the same error processing method. My first naive thought was to define a custom error event method for my form and then have it magically become the error event method of its contained controls...but of course, inheritance doesn't work that way so... no free lunch this time. Still, being able to do something like that might be kind of cool.

As I said before, this conversation has kind of become acedemic now because I have learned what I need to know to achieve my ends. Still, if you want to articulate further, be my guest...it's all very interesting.
"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