Re: notifications vs delegates (was: The fuzzy aspects of Cocoa)
Re: notifications vs delegates (was: The fuzzy aspects of Cocoa)
- Subject: Re: notifications vs delegates (was: The fuzzy aspects of Cocoa)
- From: Jay Kuri <email@hidden>
- Date: Thu, 28 Feb 2002 01:22:01 -0600
1) The app registers one (or several) of it's objects to receive
notifications and the framework builds the notification names
dynamically.
I don't see why the *names* of the notifications need to change.
They _could_ be different on an app by app basis. Different
network message request types would cause different notifications. The
notification names would reflect this so that different objects could
deal with different request types without needing to have a single
object receive the notification and farm it out based on type.
or 2) Have the framework use a dictionary or other container holding a
series of (id *)'s and using an informal (or formal) protocol to
deliver the messages via method calls. (of course, the objects would
have to register themselves with my object in this case)
..in which case you're re-implementing the
NSNotification/NSNotificationCenter classes.
right. best to stick with something people already know and
understand. I'm not a big fan of 'reinvent it here' anyway. ;-)
How would you do it?
Probably the way that NSTask does. You send a notification whenever
one of your packets arrives.
That's how I'm going to do it I think. It just makes the most sense.
Thanks again for all your help,
Jay
_______________________________________________
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.