Re: Singleton
- From: Jolyon Smith <jsmith@xxxxxxxxxxxxxxxxxxxxx>
- Date: Thu, 17 Jan 2008 14:24:53 +1300
In article <478ea196$1@xxxxxxxxxxxxxxxxxxxxxx>, Chris Rolliston says...
You're essentially simulating a "static" variable as in C/C++ using
this ugly {$J+} switch.
In newer Delphi versions I would suggest using a private class var
instead of a global variable or a writeable constant.
It's not 'ugly'. What's wrong with static variables? It keeps the
code all together, unlike your alternatives - a global var is be
definition outside
It might help some people to sleep easier at night to
accept/acknowledge/recognise that there is no such thing as a global var
in Delphi.
Just call it an "implementation variable" rather than a "global
variable" if it makes you (ie. "them") happier.
:)
--
JS
TWorld.Create.Free;
.
- References:
- Singleton
- From: Alan T
- Re: Singleton
- From: Chris Rolliston
- Re: Singleton
- From: Jens Mühlenhoff
- Re: Singleton
- From: Chris Rolliston
- Singleton
- Prev by Date: Re: EU is on the loose.
- Next by Date: Re: EU is on the loose.
- Previous by thread: Re: Singleton
- Next by thread: Re: Singleton
- Index(es):
Relevant Pages
|