• 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: Cocoa et al as HCI usability problem
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Cocoa et al as HCI usability problem


  • Subject: Re: Cocoa et al as HCI usability problem
  • From: Peter Duniho <email@hidden>
  • Date: Mon, 19 May 2008 11:00:31 -0700

On May 19, 2008, at 10:48 AM, Greg Titus wrote:

You've translated the Objective-C syntax into C# syntax, but the point of the question is to think about what prepareWithInvocationTarget() does. How would you write that method in C#?

Well, it was a poorly stated question then. His primary presentation asked how I'd write the code he posted, not the supporting implementation details.


In Objective-C, after you call -prepareWithInvocationTarget: on an NSUndoManager, it then accepts _any_ message call of any kind. It is completely and totally dynamic. It accepts messages from your application which weren't defined and didn't exist when the NSUndoManager class was compiled. The undo manager accepts the message, saves the target and method invocation with an arbitrary number of arguments and is able to re-invoke it later on the original target when the user asks you to Undo.

Thanks. That certainly makes the example more clear, and make more sense.


That said, because of the existence of reflection in C# and Java, similar functionality isn't really that difficult in those languages. It's trivial to take any arbitrary class or instance of a class and invoke any arbitrary named method with an arbitrary number of arguments, immediately or later as necessary.

I would agree that in the light you've offered, the NSUndoManager offers a somewhat more compelling use case than previous examples. But it's not true that the C# or Java version would be significantly different. They would be only slightly more verbose (though yes, I admit...they would be more verbose, albeit slightly).

Pete
_______________________________________________

Cocoa-dev mailing list (email@hidden)

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:
This email sent to email@hidden


  • Follow-Ups:
    • Re: Cocoa et al as HCI usability problem
      • From: Greg Titus <email@hidden>
    • Re: Cocoa et al as HCI usability problem
      • From: Bill Bumgarner <email@hidden>
References: 
 >Re: Cocoa et al as HCI usability problem (From: Peter Duniho <email@hidden>)
 >Re: Cocoa et al as HCI usability problem (From: Greg Titus <email@hidden>)

  • Prev by Date: Re: Delegates
  • Next by Date: Re: CATransactions not working
  • Previous by thread: Re: Cocoa et al as HCI usability problem
  • Next by thread: Re: Cocoa et al as HCI usability problem
  • Index(es):
    • Date
    • Thread