• 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: Cocoa coding style (was Re: Did I reinvent the wheel?)
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Cocoa coding style (was Re: Did I reinvent the wheel?)


  • Subject: Re: Cocoa coding style (was Re: Did I reinvent the wheel?)
  • From: Western Botanicals <email@hidden>
  • Date: Sat, 10 May 2008 20:29:36 -0600

Since the use of the singleton method has been a big issue, I'll post my reasonings for using it. Not that they are right, but I would like some comments on why I shouldn't use it for these reasons.

1. I used this page to implement the singleton method: http://developer.apple.com/documentation/Cocoa/Conceptual/CocoaFundamentals/CocoaObjects/chapter_3_section_10.html . This is the reason why some of the methods may look like the have been overwritten. I just followed the instructions.

2. I see why it would be important to leave the decision up to the developer to decide whether or not to have more than one instance of a class. The reason for using the singleton method was to ensure that I never have more than one cache or database access object. Having more than one cache or database access object could lead to having the same data pulled from the database into more than one object. Having more than one object of the same data could cause the data to become dirty.

Justin Giboney

_______________________________________________

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


  • Follow-Ups:
    • Re: Cocoa coding style (was Re: Did I reinvent the wheel?)
      • From: Jens Alfke <email@hidden>
References: 
 >Did I reinvent the wheel? (From: Western Botanicals <email@hidden>)
 >Cocoa coding style (was Re: Did I reinvent the wheel?) (From: Chris Hanson <email@hidden>)
 >Re: Cocoa coding style (was Re: Did I reinvent the wheel?) (From: Michael Watson <email@hidden>)
 >Re: Cocoa coding style (was Re: Did I reinvent the wheel?) (From: Chris Hanson <email@hidden>)
 >Re: Cocoa coding style (was Re: Did I reinvent the wheel?) (From: Jim Correia <email@hidden>)

  • Prev by Date: Re: Cocoa coding style (was Re: Did I reinvent the wheel?)
  • Next by Date: Re: wordRangeForRange implememtation
  • Previous by thread: Re: Cocoa coding style (was Re: Did I reinvent the wheel?)
  • Next by thread: Re: Cocoa coding style (was Re: Did I reinvent the wheel?)
  • Index(es):
    • Date
    • Thread