FROM : Jonathan del Strother
DATE : Wed Feb 20 22:15:13 2008
On Wed, Feb 20, 2008 at 9:03 PM, James Hober <<email_removed>> wrote:
>
> On Feb 20, 2008, at 12:04 PM, Jerry LeVan wrote:
>
> > It seems to me that a singleton object could be used
> > to hold lots of global state info and it would be
> > easy to instantiate the singleton in each of the
> > source files to access the stashed info...
> >
>
> > Is this a reasonable way to share info?
>
> Sometimes you just create a single instance of a class.
>
> Other times you enforce that only zero instances or one instance can
> ever be created. To do this second thing,
>
> http://developer.apple.com/documentation/Cocoa/Conceptual/
> CocoaFundamentals/CocoaObjects/chapter_3_section_10.html
>
...and if you don't want to re-implement that for each of your
singletons, FTSWAbstractSingleton is a nice starting point -
http://www.cocoadev.com/index.pl?FTSWAbstractSingleton
DATE : Wed Feb 20 22:15:13 2008
On Wed, Feb 20, 2008 at 9:03 PM, James Hober <<email_removed>> wrote:
>
> On Feb 20, 2008, at 12:04 PM, Jerry LeVan wrote:
>
> > It seems to me that a singleton object could be used
> > to hold lots of global state info and it would be
> > easy to instantiate the singleton in each of the
> > source files to access the stashed info...
> >
>
> > Is this a reasonable way to share info?
>
> Sometimes you just create a single instance of a class.
>
> Other times you enforce that only zero instances or one instance can
> ever be created. To do this second thing,
>
> http://developer.apple.com/documentation/Cocoa/Conceptual/
> CocoaFundamentals/CocoaObjects/chapter_3_section_10.html
>
...and if you don't want to re-implement that for each of your
singletons, FTSWAbstractSingleton is a nice starting point -
http://www.cocoadev.com/index.pl?FTSWAbstractSingleton
| Related mails | Author | Date |
|---|---|---|
| Jerry LeVan | Feb 20, 19:16 | |
| j o a r | Feb 20, 19:29 | |
| James Hober | Feb 20, 22:03 | |
| Jonathan del Strot… | Feb 20, 22:15 | |
| Graham | Feb 20, 23:59 | |
| j o a r | Feb 21, 00:14 |






Cocoa mail archive

