Re: NEWBIE: Why use protocols?
Re: NEWBIE: Why use protocols?
- Subject: Re: NEWBIE: Why use protocols?
- From: Thomas Davie <email@hidden>
- Date: Wed, 18 May 2005 20:18:35 +0100
Thanks, I hadn't realised they were transfered to runtime, or in fact
the problems they cause with bundles... I'll think a bit more
carefully about using them – this is what I get for coming from a
background of nice strongly typed languages - the impression that
type systems are a good thing (TM).
Bob
On May 18, 2005, at 8:07 PM, Ondra Cada wrote:
Bob,
On 18.5.2005, at 20:39, Thomas Davie wrote:
It is never *needed* to use protocols in the same way as you could
define every pointer in C as a void*, it's merely another
convenience of the language that assists you the programmer in
getting your job right. If an object is supposed to subscribe to
a protocol, then the type checker can check that you haven't
bungled your code for you :)
Ammm... there's a bit more than this. Namely, a formal protocol
(unlike an informal one!) is a runtime object, which (among other)
can be enquired for signatures of its messages.
Agreeably that is in fact needed *quite* seldom, but sometimes it
just might (like with the DO I've mentioned before).
---
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