• 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: Ondra Cada <email@hidden>
  • Date: Wed, 18 May 2005 21:14:34 +0200

Bob,

On 18.5.2005, at 20:55, Bob Ippolito wrote:

Don't bother with them, unless you're dealing with some ancient API that wants you to create or implement them (Distributed Objects, NSCoder, etc.). As mentioned, the "modern" way is to define informal protocols...

I don't like formal protocols, *but* pray tell me, what is the "modern" equivalent of their usage for defining the signatures in case other ways of getting them are impossible or would be too expensive? That's, IIRC, how they are used in DO (which I would by no means can "ancient API", but that's another story).


Also that's how I've used them in a few internal frameworks of mine, which need to define method signatures for non-existing methods. If there's a better way to do that than getting signatures (of methods which are not implemented in any class) from formal protocols, just please let me know: the protocol-way is ugly, but I know of none other. Defining dummy classes with dummy methods just for that seems to me even *much* uglier :)
---
Ondra Čada
OCSoftware: email@hidden http://www.ocs.cz
private email@hidden http://www.ocs.cz/oc



_______________________________________________ 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
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>)
 >Re: NEWBIE: Why use protocols? (From: "Ben D. Jones" <email@hidden>)
 >Re: NEWBIE: Why use protocols? (From: Bob Ippolito <email@hidden>)

  • Prev by Date: Re: NEWBIE: Why use protocols?
  • Next by Date: Re: NEWBIE: Why use protocols?
  • Previous by thread: Re: NEWBIE: Why use protocols?
  • Next by thread: Re: NEWBIE: Why use protocols?
  • Index(es):
    • Date
    • Thread