Re: Bindings paradigm
Re: Bindings paradigm
- Subject: Re: Bindings paradigm
- From: Chris Hanson <email@hidden>
- Date: Sat, 10 Jul 2004 15:37:54 -0700
On Jul 10, 2004, at 1:18 PM, Gwynne wrote:
#2 is pretty simple, but to me it seems to violate the principle of
KVC because it doesn't represent any data in the model but rather a
state of the view that would have been the controller's responsibility
before bindings came along.
It doesn't really violate encapsulation, because the value you'd be
exposing represents the ability to perform some manipulation on your
model object. So don't call it "action"ButtonEnabled, call it
can"Action".
You can even use +setKeys:triggerChangeNotificationsForDependentKey: to
indicate that changes to the values of any of the keys used to
determine whether you can perform the desired action will result in an
update of the key indicating whether the action can be performed. Or
you can just use a setter to manipulate its value...
-- Chris
--
Chris Hanson <email@hidden>
http://www.livejournal.com/users/chanson/
_______________________________________________
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.