Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
JVP's mid-tier inheritance challenge
Message
General information
Forum:
Visual FoxPro
Category:
Classes - VCX
Miscellaneous
Thread ID:
00324138
Message ID:
00325053
Views:
25
>Interface Inheritance - defines a new interface in the terms of one or more existing interfaces. This is what VFP inheritance is actually all about right?
>
>Implementation Inheritance - defines a new implementation in terms of one or more existing interfaces. This is what the VB "implements" keyword is all about right?
>

Actually, you got these right, but VFP is the one with Implementaiton Inheritance, VB has the Interface Inheritance. Interface Inheritance only inheriets the Methods and Properties, but not any of the values or functions of those things... so, if you had a class in VFP like...
Define Class Person as Custom

cFirstName = ""
cLastName = ""
nWeight = 0

Function Shave
   Wait Window "Shaving..."
   Blah blah
EndFund

EndDefine
**************
The Interface of Person is the methods and properties. So... using VFP lets pretend we only get an Interface inherited when you create a subclass (implment and interface)
Define Class Employee as Person

EndDefine
So... if we instantiate Employee now, we can call the message Shave() but it won't DO anything... the Implementation of Shave wasn't inherited, only the fact that the Shave() method exists (interface) was inherited.

Of course, in VB you can use the implementation of the 'parent class' by instantiating it and calling its method... which is basically what VFP does for you automatically.


BOb
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform