Mike Yearwood
Toronto, Ontario, Canada
>>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.
Not at all. I said leaving the properties on such a public object public is no better than public variables.
Previous
Next
Reply
View the map of this thread
View the map of this thread starting from this message only
View all messages of this thread
View all messages of this thread starting from this message only