Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Error : Illegal redefinition of variable
Message
From
03/08/2013 09:09:58
 
 
To
02/08/2013 12:20:27
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Environment versions
Visual FoxPro:
VFP 9 SP2
OS:
Windows XP
Network:
Windows XP
Database:
Visual FoxPro
Application:
Desktop
Miscellaneous
Thread ID:
01579124
Message ID:
01579811
Views:
57
>>>You would make those PRIVATE at the highest level - even if they are populated in a called component. That way one still has zero NEED for PUBLIC.
>>>PUBLIC variables can be created anywhere in the lexical hierarchy and that allows one object to break encapsulation. Again, avoiding public forces one to do things properly.
>>
>>The always used objects - easy. But things like a logger which may not always be used - that I'd create in a function in a file housing the class and helper code and then public allows creation later (even in the debugger). Having only sometimes needed privates defined cluttering variable space on top layer IMO would be worse.
>
>Then I would prefer properties on the application main object and use late instantiation when accessing the property the first time. For instance
>
>LOCAL loLogger AS ErrorLogger of Logger.vcx
>loLogger = poApplicationControl.ErrorLogger
>loLogger.DoLog("Error message...")
>
Agreed if only working in one fwk/at one client. Otherwise discrete objects IMO are better, even if only not to remember where in the hierarchy here and under what name thesucker was hiding...
Previous
Reply
Map
View

Click here to load this message in the networking platform