• 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: NEWBIE: Why use protocols?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: NEWBIE: Why use protocols?


  • Subject: Re: NEWBIE: Why use protocols?
  • From: "Ben D. Jones" <email@hidden>
  • Date: Wed, 18 May 2005 14:32:09 -0400

The reason I ask is that I'm actually starting on a very large project (my first big project) in Cocoa. Having done large projects in C I'm not a newbie to programming, just Cocoa. So in what cases (example of use) would it be needed or proper to use protocols?

~Ben

On May 18, 2005, at 1:45 PM, Ondra Cada wrote:

Daniel,

On 18.5.2005, at 19:05, Daniel Jalkut wrote:


Also keep in mind that a protocol allows the method declarations to stay in one place (the protocol definition) without requiring them to be redundantly defined in each class that conforms to the protocol.

Consider your idea that you might as well just put the declarations in the object. You could do that, but then if the protocol changes in any way, you run the risk of having objects that are no longer conforming but do not trigger any errors on build.


Right, but (a) you don't need formal protocols for this (an informal one can be used just as well), (b) beware that it might not work quite well with separate bundles.
---
Ondra Čada
OCSoftware: email@hidden http://www.ocs.cz
private email@hidden http://www.ocs.cz/oc





Ben D. Jones Apricle Technologies http://www.apricle.net


_______________________________________________ Do not post admin requests to the list. They will be ignored. Cocoa-dev mailing list (email@hidden) Help/Unsubscribe/Update your Subscription: This email sent to email@hidden
  • Follow-Ups:
    • Re: NEWBIE: Why use protocols?
      • From: Ondra Cada <email@hidden>
    • Re: NEWBIE: Why use protocols?
      • From: Bob Ippolito <email@hidden>
    • Re: NEWBIE: Why use protocols?
      • From: Thomas Davie <email@hidden>
References: 
 >NEWBIE: Why use protocols? (From: "Ben D. Jones" <email@hidden>)
 >Re: NEWBIE: Why use protocols? (From: Cameron Hayne <email@hidden>)
 >Re: NEWBIE: Why use protocols? (From: Daniel Jalkut <email@hidden>)
 >Re: NEWBIE: Why use protocols? (From: Ondra Cada <email@hidden>)

  • Prev by Date: Re: CIImage - saving the file?
  • Next by Date: Re: Size of comboboxes in an NSTableView / NSTableColumn
  • Previous by thread: Re: NEWBIE: Why use protocols?
  • Next by thread: Re: NEWBIE: Why use protocols?
  • Index(es):
    • Date
    • Thread