After squashing a couple nasty bugs this weekend, I got to thinking about the performance implications of my solution. In a nutshell, the solution required wrapping getter methods with code to establish the ownership link between the value and the object. This wrapping only occurs for properties that are observed or part of a dependent [...]
Category Archives: Coherent
New Tutorial on Writing Widgets
As the release of Coherent looms nearer, I’ve been encouraged to start writing some documentation. My first effort is up: Writing a Widget. This tutorial takes you through creating a widget using Coherent starting with raw mark up and ending with a functional (if simple) widget. Thanks to some great feedback (and encouragement) from Neil [...]
Pitting JavaScript Against Objective-C
In many ways, the API of Coherent is drawn from various Cocoa APIs: NSKeyValueCoding, NSKeyValueObserving, NSKeyValueBindingCreation, NSArrayController and others. Of course, some allowances have to be made for the syntax differences between Objective-C and JavaScript. So methods like setValue: forKey: from NSKeyValueCoding become setValueForKey on coherent.KVO. But where possible, I’ve tried to adhere to the [...]
Deviation from the Spec
As I’m writing the documentation for various parts of the library, I’ve come across several places where I’m not adhering to the Cocoa spec exactly. In some cases, I think my implementation makes better sense for JavaScript. But in others, it’s clear in hind sight why Apple chose to design the API the way it [...]
Automatic Change Notifications in Coherent
I’ve written a little bit about an exciting new feature in the Coherent library: automatic change notifications. In short, this reduces the amount of code you need to write and if your application only needs to support a Class A browser (like Safari 3 or Firefox), you can rely on JavaScript’s support for property getter/setter [...]