• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Cocoa bindings and reluctance to use NSPopupButon
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Cocoa bindings and reluctance to use NSPopupButon


  • Subject: Re: Cocoa bindings and reluctance to use NSPopupButon
  • From: Georg Tuparev <email@hidden>
  • Date: Tue, 03 Jun 2008 21:40:23 +0200

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

_______________________________________________

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


  • Prev by Date: Design Patterns -- Views
  • Next by Date: Re: Code to convert NSDictionary to binary plist file?
  • Previous by thread: Design Patterns -- Views
  • Next by thread: NSTextView programmatically apply smart quotes?
  • Index(es):
    • Date
    • Thread