Re: Design Question: Pro & Cons of KVC/KVO
Re: Design Question: Pro & Cons of KVC/KVO
- Subject: Re: Design Question: Pro & Cons of KVC/KVO
- From: Graham Cox <email@hidden>
- Date: Fri, 22 Aug 2008 14:52:20 +1000
On 22 Aug 2008, at 2:22 pm, Phil wrote:
Why use NSNotifications when there's already
perfectly good notification mechanism?
Indeed, but notifications have been around a lot longer than KVO, so
there are still plenty of places in Cocoa that notifications are used
for legacy reasons.
Also, as others have mentioned, they are better when you have more
than one object that you might have an interested in. With KVO you
have to subscribe to each individually, with notifications you can
subscribe to the same notification from any object that might send it.
Horses for courses, as usual.
My point was that notifications are a messaging mechanism; KVO or
rolling your own aren't the only games in town. So notifications
should be considered when thinking about messaging. If subsequently
rejected for a given design, so be it.
cheers, Graham
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden