>>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...")
>>
>
>I posted in Foxite long ago about this, to me is just a case of semantics, there is no difference between a PUBLIC poApplicationControl object with a PUBLIC property called ErrorLogger and a PUBLIC variable called ErrorLogger, in fact I would argue that an object should have NO public properties at all (this is probably for I learned OO long time ago using Smalltalk). Anyways, for the global object approach, that many people mentions, to have some usefulness it should be a much complex class and not only one full of PUBLIC properties but one that restricts the access and assignment of PRIVATE properties, for example I think it is better.
>
>
>LOCAL loLogger AS ErrorLogger of Logger.vcx
>loLogger = _SCREEN.ApplicationControl.getErrorLogger()
>loLogger.DoLog("Error message...")
>
I agree, good for pointing that out, I haven't thought so far. In fact I do have this strategy implemented as well. It's only a small disadvantage in VFP that the intellisense does not make a difference between public and private properties, it would have been nice if the private ones would not be visible in intellisense.
Christian Isberner
Software Consultant