On Sun, 20 Dec 2009 15:39:08 -0800, Dave Carrigan <d...@rudedog.org> said:
>
>On Dec 20, 2009, at 3:29 PM, Graham Cox wrote:
>
>> I think what the OP was talking about was making a called method sensitive to
its caller, which is a no-no.
>
>
>That's what I thought the OP was saying, and I agree. It would mean that doing
a refactor and changing a method's name, or even adding a new parameter to a
method, would break the code in some unrelated method. That's a huge maintenance
problem.

Well, I took the OP to mean just the opposite. Procedures often have to be
broken into two parts, esp. because of sheets; so, you might start out in
doMyThing:, but then you show a sheet and after the delegate callback you
want to proceed to doMyThingPart2:. Since the latter name is derivable from
the former, passing _cmd is a sensible way to generalize this situation, and
it's the exact opposite of a huge maintenance problem; provided the naming
convention is obeyed (a common enough pattern in Cocoa), pairs of methods
can be introduced or removed at will as development proceeds. m.

-- 
matt neuburg, phd = m...@tidbits.com, <http://www.tidbits.com/matt/>
A fool + a tool + an autorelease pool = cool!
AppleScript: the Definitive Guide - Second Edition!
http://www.tidbits.com/matt/default.html#applescriptthings



_______________________________________________

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 arch...@mail-archive.com

Reply via email to