JavaFX
Closures in Compiled JavaFX Script
One of the very useful (and cool) features of compiled JavaFX Script will be closures. In a nutshell, JavaFX Script closures provide the ability to define a function within another function with the inner function having access to the local variables of the outer function. This feature is enabled by the fact that in compiled JavaFX Script, functions are first-class objects, which provides the ability to assign functions to variables and to pass functions as arguments to other functions.
Reader Feedback : Page 1 of 1
#3 |
Aaron Romine commented on the 22 Jan 2008
I actually stumbled on this article as I was searching about JavaFX because someone mentioned that JavaFX didn't support inner functions. In my googling I came across this. Good to see that isn't the case. Thanks for the list and link. We haven't had a need for JavaFX yet, but I always like to keep the language option open. Thanks! |
#2 |
Aaron, Good to hear from you. It's interesting that you would respond to this particular post, as I recall that you first introduced closures to me (in the context of JavaScript). The major benefits that I see with JavaFX Script are: * declaratively expressing the UI, including layout widgets * binding the UI to a model, and its innate ability to do the MVC pattern * attribute triggers * leveraging Java classes and compiling to JVM bytecode * excellent 2D graphics, and soon to come animation, support. 3D graphics will follow. All of the above are implemented in a simple, elegant, and fun to use way. Please see my [[visit link] Putting My CTO Hat On] post for more details on my rationale for utilizing JavaFX Script. Thanks, Jim Weaver "Helping You Become a JavaFXpert" weblog: [visit link] |
#1 |
Aaron Romine commented on the 18 Jan 2008
Nice article. I'm just starting to look at JavaFX and want to know the benefits of use it verse something like Rhino. It seems that Rhino offers many of the same capabilities (using native java classes) and is already integrated with some projects, like Apache Cocoon. Rhino being JavaScript, I am more familiar with it. Other than JavaFX being strongly typed, what other benefits does JavaFX provide? |