Sunday, March 16, 2014

The Siren Call of KVO and (Cocoa) Bindings

Marcel Weiher:

Bindings are one-way dataflow constraints, specifically with the equation limited to y = x1. More complex equations can be obtained by using NSValueTransformers. KVO is more of an implicit invocation mechanism that is used primarily to build ad-hoc dataflow constraints.

[…]

Anyway, when you add it all up, my conclusion is that while I would really, really, really like a good constraint solving system (at least for spreadsheet constraints), KVO and Bindings are not it. They are too simplistic, too fragile and solve too little of the actual problem to be worth the trouble. It is easier to just write that damn state maintenance code, and infinitely easier to debug it.

DenisM:

KVO is akin to manual memory management - a lot of individual pieces to tweak and remember, and the outcome is very brittle and error-prone.

2 Comments RSS · Twitter


[…] The Siren Call of KVO and (Cocoa) Bindings […]


[…] it curious that Cocoa Bindings existed on MacOS, but were never ported to iOS. Apparently they were slow and fragile, but… so are all of the awful hacks people seem to do in UIKit to keep their UI in […]

Leave a Comment