Posted by opinali
on January 7, 2009 at 7:20 AM PST
I've been busy over the last weeks, evaluating and learning the Java FX
platform. I'm between optimistic and
enthusiastic about JFX, but wandering forums and blogs over the net,
this doesn't seem to be the general impression - to date, most
community feedback (ignoring official advocates like Sun engineers) seems to be negative.
Java FX vs. Swing
Part of the attacks to Java FX comes from Swing developers who see JFX as something that's just diverting effort from Sun; and in the long run, could imply Swing's obsolescence. Certainly not a deprecation, but a slow death if no major improvements happen as Sun and the larger ecosystem moves to support JFX exclusively. Personally, I don't think the JFX/Swing competition is a major issue, but that's because I don't think Swing has a big potential to become substantially better - it's a decade-old legacy that wasn't designed for today's needs. Let's do a short reality check:
- Mobile support: LCDUI exists because Swing was too damn big, complex, white-box, and unfriendly to "heavyweight" (= lightweight, in Swing Newspeak) components; so a reasonable subset couldn't be cut for MIDP devices. What about AGUI? The timid success of the CDC configuration in the higher-end devices is not very commending of Swing either.
- Ease of Development: Swing's never got kudos for its learning curve. Arguably, this could be partially fixed by the Java language: if we had properties, closures and other goodies... but (unfortunately) we're not going to have those features even in Java SE 7. JSR-295 could help, but without properties, it would be a clumsy workaround (at least compared to Java FX's binding).
- RIA: Java2D is a great API but it's just too arcane to write graphically rich and creative UIs. Even before Java FX, traditional GUI APIs were defecting to alternative models that push the visuals to some kind of DSL, from Android's layout files to full-blown solutions like XAML.
I won't lose more time with the JFX/Swing debate, just point the obvious fact that JFX avoids all problems above; in fact, it is designed from scratch to solve these problems.
Now, let's take on the other serious critics that Java FX gets: remarkably, that it compares unfavorably with Flash or Silverlight, and/or Sun doesn't have the resources to push JFX in the market against those competitors even if JFX is technically competitive. There are actually many dimensions to this debate.
There is JFXBuilder, and Sun promises a visual editor in time for JavaOne'09; the Production Suite should keep improving too. If Adobe's products are sufficiently extensible, Sun could subvert them into a well-integrated JFX tooling. Some wishful thinking, but more likely than Sun having resources to create (or money to buy) a major illustration tool, like Microsoft did with Expression for Silverlight. There are "independent" products like Xara, Canvas, Corel; even FOSS ones like Inkscape. I have no idea if any compete with Adobe's [for RIA design], but I feel that Sun should support additional tools. In any event, I don't buy that Sun should shy away of the RIA competition just because Adobe has a near-monopoly on the tooling.
Not all RIAs are going to be multimedia extravaganzas. For many business GUIs, RIA means just refreshing boring form-based displays with modest eye-candy that could even be programmed in Swing/J2D... but if JFX makes that programming much easier, or even trivial with a good IDE-centric designer, that's sufficient to justify JFX's existence. The point is, Java FX's public is not only designers coming "down" from Flash or web design and professional drawing tools - it's also programmers like me, coming "up" from Java hacking, whose most sophisticated visual tool is Matisse. Granted, the facts that all JFX demos out there seem to be targeted at the former public - and the modest support for conventional GUIs in javafx.ext.swing, while Sun doesn't release a set of native components - don't help to properly evaluate the platform.
What is Java FX's competition? Flash Lite is well deployed (although not much used), but it's a limited platform... that can't be boosted into AIR. (Adobe has talked about AIR Mobile since mid-2007, but there's nothing concrete to date.) JFX lies on top of the entire Java ME stack, enabling full-featured applications. Silverlight for Mobile is a credible competitor but it's also an upcoming runner; its runtime will be bigger than JFX for OTA install, and will support only WinMob and S60 at launch. Conventional SDKs like iPhone's, Symbian etc. are much harder to program, and their story of desktop portability ranges from null to very poor.
And what about the massive low-end to midrange devices (where CLDC/MIDP rules today)? Applications written for the iPhone or Silverlight will only run on expensive smartphones and PDAs; but JFX apps can target cheaper devices that outnumber those 10-to-1, and still scale (make full use) of the features of devices that cost your eyeballs, not to mention desktops.
To summarize, please notice that I'm not saying that Java ME + Java FX owns this game and will crush everything from Flash Lite to the iPhone. I'm just pointing that those competing platforms are not perfect, they have important weaknesses, and JFX has important strengths. Most likely, JFX will be very successful in the smaller devices, and in the high-end it should gain at least a respectable share of the market (hopefully, more than CDC platform did to date).
Some people argue that Java FX may even be good, but other RIA platform is just as good or better, arrived earlier in the market, is already more supported by tools etc. so why not just using it? One good answer: It's not Java. And don't read that as a simple "I'm too lazy to learn a completely different platform" - Java FX also requires significant retraining, even though less than an alien platform.
I love the whole Java platform and ecosystem, that provides huge value that's also available for JFX development. I can use my favorite IDEs and APIs. I can rely on big vendors (IBM, Oracle, Sun) or a huge FOSS community (Apache, GNU etc.) so Java is great for any ideology or business needs. The entire Java ME/SE/EE stack is both open source and commercially supported (that will soon be true for JFX too). Java sustains values like platform neutrality, open standards, and backwards compatibility, very seriously (people who'd complain of the eventual breaking changes in Swing or other small holes in those values, didn't come from a previous developer life with most other platforms). The JRE is a wonderful runtime - its performance massacres most other VMs; its RAS capabilities are a developer's & sysadmin's dream with virtually no competition from competing platforms.
Well, I could go on but this should be sufficient. Because of everything that the Java platform gives me, I'm not moving to something else to build a RIA unless Java has no reasonable alternative (many would claim that point as true before JFX); or if the competitor is much superior to Java.