Am 19.05.2008 um 13:11 Uhr schrieb Peter Duniho:
I just don't see how declaring an interface and then using it is so inferior to an informal protocol that it justifies the entire message-dispatching paradigm, especially given that there are in fact advantages to the former. At best, it's a wash.

I'm so used to the Objective-C/Smalltalk way that I admit I haven't thought this through, but two things come to mind:

* Objective-C allows you to create categories, effectively modifying a class's interface at runtime. This is handy for adding methods that more naturally belong to an existing class rather than as, for example, static methods in a utility class: [myString endsWithAVowel] rather than [MyStringUtils stringEndsWithAVowel:myString]. Categories also allow you to add a behavior to an internal node in a class hierarchy, and thus to that class's existing and future descendants -- an annoying problem to solve when the only way you have of modifying a class is by subclassing.

* Interface Builder is sometimes given as an example of an app that would be more difficult to write in, say, Java. I haven't thought through exactly how I would write it in Java, so I'm not prepared to argue this case just yet. I suspect I would have to do it by bypassing some of the very protections that Java gives me.

--Andy


_______________________________________________

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

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:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to [EMAIL PROTECTED]

Reply via email to