• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Singleton as a common area?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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


References: 
 >Singleton as a common area? (From: Jerry LeVan <email@hidden>)

  • Prev by Date: Re: How to draw a CGImage object to a NSView?
  • Next by Date: BaseTen - Anyone Using It?
  • Previous by thread: Singleton as a common area?
  • Next by thread: Re: Singleton as a common area?
  • Index(es):
    • Date
    • Thread