Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Class keeps changing DataSession
Message
From
01/08/2002 14:22:59
Charlie Schreiner
Myers and Stauffer Consulting
Topeka, Kansas, United States
 
 
To
01/08/2002 13:47:07
General information
Forum:
Visual FoxPro
Category:
Classes - VCX
Miscellaneous
Thread ID:
00684772
Message ID:
00685135
Views:
26
Hi Bill,
I advocate never relying on SET DATASESSION TO x in code. Debugging yes, but not for production. Each object wants to work in the datasession it was created in. It knows that environment, somehow, and knows to set it when one of its methods is called. I'm sure there are folks who use SET DATASESSION TO effectively, but it seems to go against the power of the fox. You call a object's method, and the right datasession is selected automatically.
In an OOP sense, you are operating on data you have no right to. The cursors in a datasession are essentially private to that DS. When a developer changes the DS, he is accessing a cursor as if it is public.
If you think though the logic of your problem, is there a way to allow the code that manipulates the data to be created in the same DS? Or perhaps pass the data to the other DS in an array?
Charlie
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform