Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Superclass vs. Subclass structures
Message
General information
Forum:
Visual FoxPro
Category:
Object Oriented Programming
Miscellaneous
Thread ID:
00151975
Message ID:
00152119
Views:
26
>But this is to our disadvantage. I think that if VFP were truer OO, all controls would indeed be subclassed from the same 'control' class.

I certainly agree with that, 100%! I've "solved" this problem by delegation, where each of my base control classes instantiates and calls methods of another class. That way, at least, I just have to put in the appropriate calls once, and can change the other class as I need to.

However, that's different from deriving each class (ultimately) from something like Object.

>>#3 might well be the best solution, if the concept of moving doesn't need to be treated polymorophically.
>
>But it does,

I don't think we can know that without knowing what the application is for. My impression was that choice #3 (and #4) wouldn't have been offered at all if polymorphic moving were a given.

My point in all this is that it's impossible to create an interface for these classes without knowing what's to be accomplished. It's not possible to create canonical forms for Vehicles, Cars, Boats, etc.

This may not be as obvious a point as it seems. I've seen many OOP texts that give examples like this without addressing the application.
Previous
Reply
Map
View

Click here to load this message in the networking platform