• 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: Protocols on the fly?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Protocols on the fly?


  • Subject: Re: Protocols on the fly?
  • From: Sherm Pendley <email@hidden>
  • Date: Mon, 28 Apr 2003 19:21:45 -0400

On Monday, April 28, 2003, at 06:48 PM, John Hvrnkvist wrote:

On Tuesday, Apr 29, 2003, at 00:30 Europe/Stockholm, Sherm Pendley wrote:

You'd only need to declare a protocol if your framework were *not* transparent - that is, if it expected the objects it receives to be able to handle a particular set of messages. In that case, you'd want to declare those methods in a protocol and verify that any objects it handles conform to that protocol.

There is more to it than that; by setting a protocol for a proxy, you decrease the number of round trips. If there's no protocol set for the proxy, it has to query the remote object for the method signature.

Yes, if your code sends any messages to the remote object, those messages should be declared in a protocol. But in that case, the framework would not be transparent - it would expect the remote objects to be able to handle the messages sent by the framework. I think Owen's writing a completely transparent framework - the framework itself doesn't send any messages to the remote object, it simply hands off any objects it receives to the host application.

The host application in this instance would, of course, want to declare a protocol of the messages it wants to send. But, that's part of the host application, not Owen's framework.

I'm assuming that Cocoa's default NSProxy is well-designed, of course, and queries for method signatures only when they're actually needed to send a message. As you said, avoiding unnecessary network chatter is important, and querying a distant object for method signatures that may never be used would be wasteful.

sherm--

C programmers never die - they're just cast into void.
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.

  • Follow-Ups:
    • Re: Protocols on the fly?
      • From: Owen Anderson <email@hidden>
  • Prev by Date: Re: embedding a dictionary in a dictionary.
  • Next by Date: Re: converting text input in any encoding to unicode
  • Previous by thread: Re: NSMovieView Interface Object Question
  • Next by thread: Re: Protocols on the fly?
  • Index(es):
    • Date
    • Thread