Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Who Called Me?
Message
From
02/11/2000 09:39:08
 
 
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Title:
Miscellaneous
Thread ID:
00436100
Message ID:
00437098
Views:
20
>When one class is derived (subclassed) from another it inherits the data & procedures (properties & methods) of the parent class. You have the choice of whether or not to redefine any of the methods of parent class. On calling a particular method for an instance of a class, a decision will be made at run-time of which class an object belongs to & whether it has it's own version of the method or if the parents method should be used (this may propogate back further if the parent was derived from another class). One obvious time this must happen is when an object is passed to a procedure as a parameter, at compile time it may not be known the particular class, so at run-time the system has to determine the class of the object to know which method should be used (or even if the object supports that method).
>
I had a feeling you were refering to methods in base classes. I don't really equate that with *different* versions of a method. Certainly there are ways in procedural languages to mimic OOP concepts, but I don't see this thread as valid parallel.

In OOP, when you create an object, the class must exist. The class itself does not have to be modified if it is called from any particular place. In the example in this thread, the function itself must be modified if the function is called from another place (I'm reading in between the lines here...we don't have specific details of the code...but the implication by the origianl poster is pretty strong that this is a true statement).

Using a parameter that says "do this or this" (with a VERY small and limited number of options) requires no change in the function once it is implemented.
Steve Gibson
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform