• 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: Notification redundancy
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Notification redundancy


  • Subject: Re: Notification redundancy
  • From: Allan Odgaard <email@hidden>
  • Date: Thu, 29 Jan 2004 14:25:23 +0100

On 28. Jan 2004, at 16:09, Erez Anzel wrote:

I have enjoyed using the notification system built into Cocoa. But the standard approach may not be the wisest in my situation, where I may have tens of thousands of objects sending notifications, and multiple observers.

You may reduce it by using NSIndexSet -- but that would be more or less the same as letting the action method send the notify.

In a case like this, it's more efficient for the action method to post the notification, instead of each object. I could make a decision at runtime as to whether the action posts the notification, or each object, depending upon how many objects are involved. But this starts to get messy; I have many different actions, many object types, and many "set" methods for each.

Any wisdom on this issue?

You could let the objects add info about what they did to their container and let the container send the notify, then, if anybody wants to know exactly what happend, they would query the sender of the notification.

But do all these 50,000 objects really need to be NSObject subclasses? i.e. do they need any of the advantages that comes with being an object (run-time polymorph method invocation, inheritance etc.), or are they just simple points, to which you have added some action methods (which could just as well be "global" functions)?
--
http://www.top-house.dk/~aae0030/
_______________________________________________
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: Notification redundancy
      • From: Ben Dougall <email@hidden>
References: 
 >Notification redundancy (From: Erez Anzel <email@hidden>)

  • Prev by Date: Re: Calculating paragraph numbers
  • Next by Date: NSTextField.objectValue returning bogus value
  • Previous by thread: Notification redundancy
  • Next by thread: Re: Notification redundancy
  • Index(es):
    • Date
    • Thread