What approach to take to communicate with objects

A while ago, I got a question : “There are a few conflicting features in Objective-C/Cocoa to accomplish same goals. What to choose?”

What are they? KVO, Notification, delegation, signaling, conditional lock and so on. You can tell other objects that something happened with those mechanisms.

My choice was to follow existing Cocoa objects’ choice. If they use Notification for certain things and those are similar to what I’m going to implement, I use Notification. If they use delegation, I use delegation, and so on.

Here, again at M-Cubed blog, things are nicely classified and summarized.
The Rules of Communication

See if it is reasonable to you. :)




Leave a Reply

Please log in using one of these methods to post your comment:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: