Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Set order / private datasession
Message
From
19/11/2001 06:25:32
Hilmar Zonneveld
Independent Consultant
Cochabamba, Bolivia
 
 
To
15/11/2001 12:48:31
Charlie Schreiner
Myers and Stauffer Consulting
Topeka, Kansas, United States
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00581452
Message ID:
00583359
Views:
28
Thanks Charlie;

I'll take your advice into account, especially if I start getting weird results...

In the meantime, to avoid making major changes to the framework I use (not created by me), I will just take the risk. So far, it seams to work.

That would be the "extenuating circumstances", I would say. Adding a custom method to the parent-of-all-dataforms seems to make sense, but I find this is too much trouble in the existing framework.

Hilmar.

>Hi Hilmar,
>Just to make it interesting and because I hear no dissenting voices...
>It seems to me that your design is flawed any time you resort to SET DATASESSION TO. Each object is responsible to know and control what goes on within it. Messages are passed to objects and the objects respond. Here I would want to send a message to the active form and tell it to reorder itself, whatever that means in the specific form's case. A toolbar button can be generic in that it knows how to send the message to any form. But when it assumes it knows how to change the datasession and set order to and refresh, etc.--well, that's quite a bit of responsiblity for a button that has incomplete knowledge of all possible forms.
>I recognize that some of the VFP foundation classes work this way, but I think the code is misplaced. Make a common interface for your forms. Talk to them through that interface. Don't sneak around behind the form's back to muck around with its innards. (obviously using language here with negative connotation)
>
>http://home.kscable.com/cschreiner/OutFoxed16.html
>
>Of course, you make have extenuating circumstances, but as a general goal, why not try to use object.method() to do work in/on an object?
>
>As to the reliablility of SET DATASESSION TO, it just depends. If the toolbar was created in the default datasession, and you have a combobox control or grid in the default datasession, your SET DATASESSION TO isn't very good. A refresh during the time you've changed the DataSessionID will be bad for that control. You can't control the internal VFP refresh, IFAIK. If you don't have those type of controls in a default datasession, you should be fine.
Difference in opinions hath cost many millions of lives: for instance, whether flesh be bread, or bread be flesh; whether whistling be a vice or a virtue; whether it be better to kiss a post, or throw it into the fire... (from Gulliver's Travels)
Previous
Reply
Map
View

Click here to load this message in the networking platform