Re: NEWBIE: Why use protocols?
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