Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Another Speed Thingy
Message
General information
Forum:
Visual FoxPro
Category:
Other
Miscellaneous
Thread ID:
00843972
Message ID:
00844009
Views:
19
Nigel,
Do you check for the existence of oParent when you make calls to it? If not, why do you need to check for the existence of oParent.oChild? If oChild is that important to your application, then I would make it required to run your application. If oChild doesn't instantiate, then oParent doesn't instantiate. If you do check, what's the difference between checking for that and checking for oChild?
type("oParent.oChild") = "O"
Having said that, I might go with the Procedure approach because you could added functionality built into it to handle the Datasession issues that exist between object calls. Calling a procedure does not change the datasession so you could add code to retrieve the current datasession, if needed. You could pass this to oParent.oChild. If you went the oParent.Method approach, you would have to pass the datasession ID from each oForm.Control call.

Performance-wise, I really don't think you would see a perceptible difference.

Just my $0.02.

>I've noticed a few threads recently regarding speed. I've decided to throw this one at you all. This is a real situation I have (I'm already using one of the scenarios) and would be interested to know the results...
>
>The players...
>
>oParent = Application Object.
>oChild = Instantiation (on oParent) of VFP DLL to do calculations.
>oForm = A Form (managed by oParent).
>Procedure = A Procedure.
>
>OK? Now what I'm achieving...
>
>Controls on oForm need to call methods in oChild. There will be quite a few calls on each form.
>
>The scenarios...
>
>A) oForm.Control calls Procedure which in turn calls oParent.oChild.Method
>
>B) oForm.Control calls oParent.Method which in turn calls oParent.oChild.Method
>
>I cannot call oParent.oChild.Method directly as I need to ensure that oChild exists and don't want to repeat the checks everywhere.
>
>Which one is fastest? Bearing in mind that this will form a central part of the application and EVERY form will have many of these calls. This is not just a single-pass test (I wouldn't put it here if it was).
>
>I'd be very interested to see what replies I get to this...
>
>TIA,
Larry Miller
MCSD
LWMiller3@verizon.net

Accumulate learning by study, understand what you learn by questioning. -- Mingjiao
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform