Re: The problem with bindings
Re: The problem with bindings
- Subject: Re: The problem with bindings
- From: Brent Gulanowski <email@hidden>
- Date: Thu, 29 Jul 2004 18:50:57 -0400
On Thu, 29 Jul 2004 20:13:15 +0200, Drew McCormack
<email@hidden> wrote:
>
I'm no bindings layer expert, but the little time I have spent using
>
them, I have found them quite difficult to grasp. Much more so than the
>
outlet-target approach.
Undoubtedly. Bindings are just the top layer of a three-layer cake
made out of KVC, KVO and KVB (coding - observing - binding). I think
KVO is by far the most obscure and difficult to adapt one's thinking
to. This I think correlates with the fact that KVO does the most
behind-the-scenes manipulation.
I think that we need more KVO examples without bindings. I'd be
interested to see what applications of KVO are possible without
bindings, or if KVO was really just a solution to a problem in
bindings (in which case, maybe there is a less obscure solution?).
Still, the NSObjectController and NSArrayController classes tend to
work best in specific types of environments, and the amount of genius
required to adapt them to atypical situations seems to be exponential
to the atypical-ness. They are really hard to subclass, I find. Though
I was unable to start using the technology until recently.
>
>
I usually find that if things go well with bindings, I really can save
>
that '300 lines of code' that everyone talks about, but when things go
>
wrong, I can spend hours tracking down the problems, effectively
>
negating any benefit I may have gained. Furthermore, easy things, like
>
populating a table view with values, are well documented, and can be
>
achieved very efficiently with bindings. But try to go a bit deeper,
>
and do something not in the manual, and it requires a considerable
>
commitment.
My feeling is that however "easy" they are to use in appropriate
cases, the simplicity (and lack of overhead) of target-action in
certain situations has seemed to make them a win. Certainly if you
need to add gazillions of object controllers, it feels like trading a
bit less code writing for a lot of bloat, but that's probably just an
incorrect impression. The extent to which one is asked to trust in the
frameworks is much higher, which is disconcerting at first (OK, still
is).
>
>
Basically, it comes down to this: bindings are very hard to debug. You
>
can't set a breakpoint, so you are left guessing at what is happening
>
based on an obscure error message from an exception thrown deep in the
>
Cocoa frameworks. Anyone else have this problem?
Well at first I was perplexed by the exceptions until I noticed that
the Run log was spitting out the problem with my use of incorrect
keys. I have been left confused by behaviours that simply don't make
sense to me, based on what I would have expected. Again, this is when
trying to subclass.
--
Brent Gulanowski
http://www.boredastronaut.com
_______________________________________________
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.