Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Best approach about #DEFINE constants
Message
 
 
To
15/05/2008 20:28:24
Mike Yearwood
Toronto, Ontario, Canada
General information
Forum:
Visual FoxPro
Category:
Other
Miscellaneous
Thread ID:
01316940
Message ID:
01317515
Views:
9
>Well, you've gotten several replies. You've already learned that privates at the top level are almost identical to public. However, the danger with public and even with pseudo public private variables is the ability for any running code to overwrite the content of the variables, with possibly drastic impact throughout the system.
>
>I saw such a thing once. It was a fatal flaw - literally. The system would have resulted in a patient deaths all because of changing one public variable.
>
>I think an application object which reads a table or ini file to get the initial values and makes the values read-only is safest. Such an object could be declared at the start of the app with private or public or bound to _screen. It could instantiate a parameter object used to hold the "public" variables. All values would be protected and accessible via get/set methods.
>
>If some code removes the application object, an error handler could shut the app down or reinstantiate the application object and the "public" variables.

In other words, we're back to using one global object which you objected at your original reply.
If it's not broken, fix it until it is.


My Blog
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform