Hi,

I just checked in the beginnings of {} databinding in FlexJS.  If you look at 
the source code, the SimpleBinding and ConstantBinding beads that were in the 
earlier examples are replaced by {} expressions.  The compiler generates a data 
structure describing the bindings, and a bead interprets the data structure and 
sets up the bindings as needed.  In this early version, the binding bead is 
looking for a specific pattern that can resolve to what should be faster 
ConstantBinding and SimpleBinding expressions.  The rest of this week I'll be 
working on more and more general and complex cases.

The reason binding is applied by a bead is because it allows you to optimize by 
replacing general databinding beads with beads that know something about the 
binding context.  For example, in this prototype, the ViewBaseDataBinding bead 
knows that it is setting up bindings for a ViewBase which means that it can 
make assumptions that, for instance, the applicationModel structure itself will 
not be changing (its properties will, but not the reference to the model).  And 
that means you can use one less watcher and you can apply initial values at 
initComplete and not necessarily at the instantiation of each widget.

-Alex

Reply via email to