German has posted 19 posts at DZone. View Full User Profile

Essential JavaFX

11.19.2009
| 6992 views |
  • submit to reddit
Published by: Prentice Hall
ISBN: 0137042795

Reviewer Ratings

Relevance:
4

Readability:
4

Overall:
4

Buy it now

One Minute Bottom Line

A great book to get you started with JavaFX because the topics are just right and the quality and accuracy of the writing (including code samples) is great. You get a step by step guide on how to set up your development environment with Netbeans, a good coverage of language elements, details about the structure of JavaFX applications, real samples including full source code and a couple of extra chapters (web services and mobile applications).

But mind you, it won't be particularly interesting to existing JavaFX coders except if they want a basic reference or training material.

Review

When I first laid my hands on 'Essential JavaFX' I thought that it was a big plus for newbies that the book assumes the reader has a basic knowledge on programming but does not require you to have a specific programming language background. It covers the latest version of JavaFX (1.2, as of this writing) and it's endorsed by Sun (actually, the book has been enriched with feedback from the JavaFX team itself since the authors were in close contact with them). As a general guideline the book encourages you to think like a designer rather than like a coder which is a good thing when you're dealing with a scene graph based RIA technology (a scene defines a hierarchical node structure that contains all the scene's components like nodes representing graphical elements).

Since this is 'Essential' JavaFX it was expected that advanced usage scenarios were omitted but this could be just fine if what you're looking for is an introduction to JavaFX. Fortunately the book includes real samples to give you a tour on JavaFX so if you're a hands on developer you'll appreciate this (full source code is available from the authors' website). The samples will give you a chance to work on a guitar tuner, a simple piano, a physics capable game and a Flickr based photo display applet. Also, the description on how to deal with graphical nodes is thorough enough for you to be able to provide custom skinnable components (including a description on CSS support) so you can get up to speed on how to create your own GUI if that's what you want.

Since I already know the basics of JavaFX I was looking for a more thorough explanation on the internals (how JavaFX code gets compiled into Java code, examples using the reflection API, working with Java objects on JavaFX and vice versa). Aside from a classic but decent description of RIA elements (graphical objects and effects, GUI elements including Swing components, animation, multimedia), language elements (operators, expressions, collections as sequences, etc) and architectural details (like program structure and application anatomy) you'll find only two chapters by the end of the book which could be considered advanced (or at least a 'plus' on top of the JavaFX core description), namely 'Web Services' and 'Mobile Applications'. 'Web Services' is a beautiful chapter since it tells you all about XML and JSON parsing plus dealing with HTTP requests in an asynchronous way. Building on this information a sample application is built which uses the Flickr API (pretty cool). I was a bit disappointed by the 'Mobile Applications' chapter since it was only basic details. It's also clear that something is wrong if that's the way in which you're supposed to support applications that target both the Desktop and Mobile profile (you'll find code like 'def sceneHeight = if (isMobile) 320 else 500;' polluting the code all over the examples). Targeting mobile is still much more tricky than simply changing the target (it's not the first time Sun throws us the unfulfilled promise of 'code once, run anywhere'). On the plus side they show you how to port the Flickr application built on the web services chapter to the mobile profile (clearly a nice integration of topics with working examples).

The lacking of advanced topics has more to do with the current state of JavaFX rather than a deliberate exclusion of topics by the authors. As a young technology (the API changes in JavaFX 1.2 caused a whole bunch of code to go obsolete) JavaFX still needs some time to be able to provide the goodies that are necessary to come up with a meaningful 'Advanced JavaFX' book. I'm still waiting for more in depth coverage of how to deal with persistence in JavaFX (specially with ORM tools or object databases) and data oriented web services (in this area, competing technologies like Silverlight from Microsoft are far more mature) and I would also like to see hands-on information on how to integrate JavaFX in an enterprise stack (including AJAX in the back-end for example). Also, having tried JavaFX for Mobile, it still feels like beta and a pretty constrained environment (MIDP, no reflection API, no Swing) (very limited when compared to Android) and the TV profile is not yet available. It would be nice to see these other topics in a future version of the book or on a follow up 'Advanced JavaFX' book.

To sum up, a great book to get you started with JavaFX because the topics are just right and the quality and accuracy of the writing (including code samples) is great. You get a step by step guide on how to set up your development environment with Netbeans, a good coverage of language elements, details about the structure of JavaFX applications, real samples including full source code and a couple of extra chapters (web services and mobile applications).

But mind you, it won't be particularly interesting to existing JavaFX coders except if they want a basic reference or training material.

Published at DZone with permission of its author, German Viscuso.

(Note: Opinions expressed in this article and its replies are the opinions of their respective authors and not those of DZone, Inc.)

Tags: