Skip navigation.
 
mlRe: Cocoa bindings and reluctance to use NSPopupButon
FROM : Georg Tuparev
DATE : Tue Jun 03 21:40:23 2008

It seams I am always 2 weeks late with my contributions ... oh well :-(

On May 19, 2008, at 2:03 AM, Erik Buck wrote:

> 1) Bindings are an ADVANCED technique that was recently introduced 
> and not yet completely documented.  If someone tries to use bindings 
> in a situation where he/she doesn't already know how to write the 
> application without bindings, it is a mistake to use bindings.
> 2) Bindings exist to _reduce_ the amount of Controller code needed 
> when the Model View Controller pattern is used.  Bindings don't 
> eliminate controller code and can't handle all Controller 
> responsibilities.
> 3) Bindings appear to be magic, but they are in fact just an 
> abstraction that enables reuse in place of commonly re-written 
> controller code.
> 4) Bindings ARE NOT A REPLACEMENT FOR ALL CONTROLLER CODE, and 
> bindings are often not the best technique to use.



For those who do not know Erik - there are very few people on this 
list who will give you such wise advises, so listen to him and you 
will learn a lot!

Back to the bindings. When I teach Cocoa I normally do not mention 
them. The reason is very simple - they are very tempting, yet advanced 
technique. When demoed by an experienced person they seam very easy. 
And indeed, they are easy if you know all the background design 
patterns in detail... not only know them, but when they are your 
second nature. Take as an example KVC. It is a style of programming, 
it is a convention. And yet so many people here are trying to bring 
with them naming and coding conventions used by other programming 
languages or development environments. It is my experience that one 
needs at least few months working together with black-belters before 
all old habits are forgotten, yet it is so tempting to go home from a 
WWDC and start clicking around.

Many people complain also about documentation. Compared with other 
environments Apple's documentation is excellent. And specially all the 
bindings stuff mmalc wrote during the past few years (together with 
his bindings examples) is just very very high quality (even the 
english is proper one :) The problem that many newcomers have is not 
the quality of the documentation, but just the staggering amount of 
knowledge one should acquire.

Final note. In my humble opinion bindings shine in two very different 
phases of the software development process.

1. During the earliest phases when many ideas need to be tested. It 
helps the brainstorming a lot when the interface is actually 
realistic, but still we do not have to cut tons of code.

2. When the project is settled and all major design decisions are 
made. Normally this is the time of massive refactoring, and what is 
better form of refactoring then removing many lines of code.

My personal experience is that in the phase where the new project 
takes shape (in terms of source code) binding are not that useful, and 
in some occasions could be more of a hassle then one could expect. But 
when a projects is getting completed, the less lines of code there are 
to be maintained the better.

just reflections on Erik's wise words...

Georg Tuparev
Tuparev Technologies
Klipper 13
1186 VR Amstelveen
The Netherlands
Mobile: +31-6-55798196

Related mailsAuthorDate
mlCocoa bindings and reluctance to use NSPopupButon Erik Buck May 19, 02:03
mlRe: Cocoa bindings and reluctance to use NSPopupButon David May 19, 03:57
mlRe: Cocoa bindings and reluctance to use NSPopupButon mmalc crawford May 19, 04:03
mlRe: Cocoa bindings and reluctance to use NSPopupButon Andreas Mayer May 19, 04:38
mlRe: Cocoa bindings and reluctance to use NSPopupButon John Joyce May 19, 04:48
mlRe: Cocoa bindings and reluctance to use NSPopupButon Brett Powley May 19, 05:29
mlRe: Cocoa bindings and reluctance to use NSPopupButon Stuart Rogers May 19, 14:51
mlCocoa bindings and reluctance to use NSPopupButon Johnny Lundy May 19, 16:00
mlRe: Cocoa bindings and reluctance to use NSPopupButon I. Savant May 19, 16:58
mlRe: Cocoa bindings and reluctance to use NSPopupButon I. Savant May 19, 17:09
mlRe: Cocoa bindings and reluctance to use NSPopupButon Georg Tuparev Jun 3, 21:40