How is the bind operator implemented in JavaFX? What happens behind the scenes? Does every variable in JavaFX implement some kind of observer API so that listeners can attach to it or is it a trick in the VM?
+1
A:
It's definitely not a trick in the VM. For some parts of the bind functionality the JavaFX complier simply generates code and some of the code are calls to a runtime component called Location. Location maintains dependencies and variable invalidation and binds. You can browse the sources on kenai if you like. Looking through de-compiled javafx classes might help your understanding too.
Honza
2009-10-29 09:25:19
So when I bind to an expression, the compiler will create locations and dependencies for all terms?
Aaron Digulla
2009-10-29 11:41:16
Yes, pretty much so. The compiler will parse the expression and add dependecies on the variables in the expression to the variable which is being bound.
Honza
2009-10-31 11:24:58