Mailing Lists: Apple Mailing Lists
Image of Mac OS face in stamp
Re: Bindings paradigm
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Bindings paradigm



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.


References: 
 >Bindings paradigm (From: Gwynne <email@hidden>)



Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2011 Apple Inc. All rights reserved.