BT

Facilitating the Spread of Knowledge and Innovation in Professional Software Development

Write for InfoQ

Topics

Choose your language

InfoQ Homepage News Bruce Eckel: Use Flex as the UI for Java Applications

Bruce Eckel: Use Flex as the UI for Java Applications

Bruce Eckel has written about the future of user interfaces in Java. He reviews the state of Rich Internet Applications (RIAs) and states that while Ajax helps, a language designed for user interfaces and rich media is what we need. He proposes that we stop trying to use one language (Java) to solve all of our problems , and instead use Flex and Apollo as a front-end for systems written in Java (or JRuby, Groovy, Scala, etc).

Eckel writes that programming for the web is not working, because current RIAs do not "work well". Developing with the combination of HTML, CSS, and Javascript is expensive and hard to make cross-platform. He points out that one of the biggest gains from the Ajax trend is that the toolkits that have surfaced abstract away the cross-platform problems. However, Ajax is not enough. Eckel states that Ajax is reaching its limit:

We do see relatively amazing Ajax-based tools like GMail and the other Google tools which are slowly seducing me (but I repeat: it took Google to create those, not Joe garage-programmer). Very nice, but is this the best you ever want to see on the web? You're seeing, if not the limit, then very close to it in those applications, and even then they don't work consistently.

Eckel says that one of the reasons Ajax has become popular is that it solves the installation problem. Java started on the internet with Applets but failed, among other reasons, because installing the JRE was so difficult. While Javascript has its own problems, it is already installed. Further complicating GUI development in Java is the lack of good media support. In the end, Eckel says GUI applications in Java is too hard.

It's not impossible to build GUI applications with Java, but it's been 10 years and there are still installation hiccups with applets, Java WebStart, and regular applications. After 10 years, people don't trust it anymore. If it's not there after 10 years, then I'm going to go out on a limb and say that someone doesn't consider this problem important enough to fix.

Eckel proposes Flash, and Flex in particular, as a UI library for Java, both for RIAs and for desktop applications. Installation is trivial, high quality UIs are easier to develop than in Java, Flex is no longer expensive, and Flex was created as a DSL for user interfaces. In the end, Eckel says marrying Flex with Java might be the best way to deliver cross-platform applications with high quality UIs:

You don't insist on using a Java database for an application; you use a specialized system like MySQL or Oracle. Sun is directly supporting the development of JRuby for hybrid Java/JRuby programming. We are seeing other special-purpose languages arise to solve specialized problems. Why insist on using a Java library for UI if a specialized system solves the problem better?

Paul Brown responds that he thinks Flex might be a step in the right direction but the problem to focus on is graceful degradation to HTML. With the growth rate of new mobile devices and platforms to view the web, the ability to get back to the common denominator is necessary.

Eokyere agrees with Eckel and hopes that the open source community will get involved with Flex, perhaps in working on an open source alternative to Flex Data Services.

Rate this Article

Adoption
Style

BT