Re: Appropriate use of bindings?
Re: Appropriate use of bindings?
- Subject: Re: Appropriate use of bindings?
- From: Citizen <email@hidden>
- Date: Tue, 7 Oct 2008 19:19:27 +0100
The following article discusses five different approaches to the
Observer Pattern in Cocoa, it may be of some use:
http://cocoawithlove.com/2008/06/five-approaches-to-listening-observing.html
- Dave
On 7 Oct 2008, at 17:31, Karan, Cem (Civ, ARL/CISD) wrote:
I'm having a slight dilemma in deciding which I should use,
notifications or bindings. Here is the background:
I have a bunch of C++ code that uses something akin to delegates;
you derive from a base class, pass that into an instance of a server
class, and the server class calls the delegate at appropriate
times. I wanted to cleanly encapsulate all of this in Objective-C,
so that the rest of my code can be pure Objective-C, so wrote
wrappers for each base class. Now, I pass the internally wrapped C+
+ instance to the server, while the rest of my code will hook up to
Objective-C wrapper.
My dilemma is how to do this hookup; I can use either notifications
or bindings, but I can't decide which is better in this situation.
Bindings seem to be simpler to use, but reading about them suggests
that you are expected to use the MVC design pattern, and I'm not
doing MVC here. Notifications are used anywhere you want, but
require more (and more careful) work to get right. So, are bindings
considered general purpose, or should they really be reserved for
MVC situations (even though they can work anywhere)?
------
David Kennedy (http://www.zenopolis.com)
_______________________________________________
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