Re: Notification redundancy
Re: Notification redundancy
- Subject: Re: Notification redundancy
- From: Erez Anzel <email@hidden>
- Date: Thu, 29 Jan 2004 11:41:54 -0500
Thanks, Allan, Florent, Ben, j o a r,
I guess I got carried away with the relative elegance of Cocoa. It was
fun while it lasted, until them darned users started wanting to use my
program for massive data sets. It's back to the drawing board for me:
time to redesign. I'll put that in a separate post to the cocoa-dev
list, under the subject "Designing for multitudinous objects."
I have put some alternative design ideas in that posting.
Thanks for your responses. Any other words of advice are always
appreciated.
Bye...Erez
On 29-Jan-04, at 8:17 AM, Allan Odgaard wrote:
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.