Quoting from a reaction to Brent Simmons’s recent entry on large Cocoa projects:
As noted by Michael Tsai, NSNotificationCenter is a singleton, and thus essentially is one big honkin’ global. Globals are bad ™.
This was posted by Andy Finnell echoing Michael Tsai.
But in fact, NSNotificationCenter isn’t a singleton. You can create as many as you want. I agree that sending every notification to the default center isn’t a good idea. It turns it into a monolithic entity it isn’t meant to be. The default notification center should be kept only for communication with the rest of Foundation and AppKit.
However, if you are careful in your designs, you can easily have sub-system notification centers which only certain class clusters know about. That way, you get the benefits of NSNotificationCenter without the problems that have been underlined by several people already.

No comments
Comments feed for this article
Trackback link
http://www.devklog.net/2007/04/26/nsnotificationcenter-isnt-a-singleton/trackback/