Re: Singleton as a common area?
Re: Singleton as a common area?
- Subject: Re: Singleton as a common area?
- From: j o a r <email@hidden>
- Date: Wed, 20 Feb 2008 19:29:29 +0100
On Feb 20, 2008, at 7:16 PM, Jerry LeVan wrote:
I have a tendency to build an object and fiddle with it
and when I understand how it works, I have to ease the
rascal into the main application.
This generally means that I have lots of source files.
<nit-picking>
You don't "build objects", you design classes. While you end up with
"lots of source files", your implied question should be "is it OK to
end up with a lot of classes" and the answer to that is: YES.
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...
<nit-picking>
Similarly, you don't apply the singleton pattern to a source file, but
to a class.
Is this a reasonable way to share info?
The singleton pattern is very useful, and I think it's reasonable to
end up with a lot of your classes being singletons.
j o a r
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden