InfoQ

News

Pivot: Re-Inventing the Java Applet?

Posted by R.J. Lorimer on Jun 15, 2008 04:01 PM

Community
Java
Topics
Rich Client / Desktop
Tags
MVC ,
GUI
This past week, Greg Brown announced a new open-source GUI toolkit for Java, Pivot:
I would like to introduce the Java development community to the Pivot platform. Pivot is an open-source framework for building high-quality, cross-platform applications that are easily deployable both via the web and to the desktop. It began as an R&D effort at VMware and is now being made available to the community as an option for developers who want to build rich client applications in Java.
Pivot borrows several ideas from toolkits such as Swing, while also taking advantage of the improvements made in the Java2D pipeline over the last several years. Applications built with Pivot will be developed using a combination of Java and XML.

Pivot, as a platform, is meant to directly compete with Flex and Silverlight as a rich-client that is embeddable directly in the browser. The Pivot developers consider part of that platform to be Java 6 update 10, also known as the consumer JRE.

In March of 2007, Greg Brown posted 'Reinventing the Applet' on his blog, where he discussed several of the shortcomings of the then-current-iteration of applet technology, and what he felt would need to be fixed to make applets more competitive. The recent announcement of Pivot was posted as a follow-up to that original article. He now describes the consumer JRE as a key element to the success of Pivot. There are a number of technologies in the JRE update that play an important role in the viability of any embedded application developed using applet technology:
  • Java kernel - The Java kernel reduces the download size of the base JRE significantly.
  • Next-Generation Java Plug-in - The new Java plugin runs as a separate process from the browser, preventing browser lock-ups, crashes, and other slowdowns. It also provides better user feedback during startup and other state transitions.
  • Java Deployment Toolkit - The deployment toolkit provides all of the necessary APIs and browser integration to provide a seamless installation/upgrade process, making it simple to determine Java version, and help users upgrade as necessary.
  • Java QuickStarter - The quickstarter takes advantage of OS disk cache (among other things) to improve Java VM startup times.
  • Direct3D Integration - For Windows users, the changes to the Direct3D pipeline should improve rendering performance for anything using Java2D. For other platforms, a similar overhaul of Java2D for OpenGL was performed previously.
Java 6 update 10 is currently in beta, and is intended for public release later this year.

The announcement of Pivot triggered a number of positive and inquisitive comments - Ben Galbraith offered a lot of input as well as a number of questions:
Looking over your classes now. Interesting how your architecture is from a high-level is very similar to Swing. The contract for components, UI delegates, listeners, etc. is all quite similar (e.g., the way layout works is in particular very similar). Were you shooting for "Swing evolved?"

I can see you've hit a few of my favorite Swing pain points:

  • preferred width and height available as separate or atomic properties
  • wrapping labels (do you support any label text formatting? doesn't look that way)
  • row-based table data model
  • built-in "form" constructs
Some addt'l questions:
  • Why in heaven did you create your own collections classes? Why, man, why?
  • Do you have any analog for Swing's UIDefaults?
  • Why did you leave state out of your Action interface? Do you have any analog to Swing's Action interface in terms of sharing action state?
  • I didn't see any layout managers; how do you handle layout? The tutorial mentioned that skins do it, but I didn't see any contract stand out (other than the built-in methods on Container).
There is a demo Pivot applet available to try, as well as a work-in-progress Tutorial. There is more information about Pivot available both at the Pivot homepage as well as on Greg Brown's blog.



Impressive! (provided if Java Update 10 is toooo Good!). by siva prasanna kumar P Posted Jun 15, 2008 6:58 PM
Loading time way too slow by José Jeria Posted Jun 16, 2008 2:34 AM
Re: Loading time way too slow by R.J. Lorimer Posted Jun 16, 2008 10:49 AM
Re: Loading time way too slow by Greg Brown Posted Jun 16, 2008 6:51 PM
Re: Loading time way too slow by Jeff Thorne Posted Jun 17, 2008 9:32 PM
Swing RIA already exists it just needs support by Gary Thompson Posted Jun 16, 2008 2:46 PM
Re: Swing RIA already exists it just needs support by Gary Thompson Posted Jun 16, 2008 2:53 PM
No offense by Richard L. Burton III Posted Jun 16, 2008 4:01 PM
Natively compiling PivotDemo reveals AWT dependency on Swing by Dmitry Leskov Posted Jun 30, 2008 4:41 AM
  1. Back to top

    Impressive! (provided if Java Update 10 is toooo Good!).

    Jun 15, 2008 6:58 PM by siva prasanna kumar P

    I have worked with many RIA Frameworks, being a Java developer at heart, like to see Java on Top of RIA world, but thats not the reality, take a look at JavaFX, I really feel it can never even compete with Flex or Silverlight, its syntax is so wired and no proper editor, many more -ve to say!

    As many people have already mentioned the main issues with applets at Greg's Blog, hope this framework tries to successfully over come some of the main issues.

    After seeing the demo, I really like the smoothness of the application, especially Drag Drop example, great work, keep rocking!.

    Siva Prasanna Kumar
    Blog : Reply

  2. Back to top

    Loading time way too slow

    Jun 16, 2008 2:34 AM by José Jeria

    It takes too long time for the applet to appear (on a dual core 2.8 ghz, 2gig ram). I first thought that it did not work at all and left the page, since all I saw was an empty page. I later tried it again and the applet appeared after 1-2 minutes. A loading indicator would be needed for this to avoid confusion. Anyway, I am not sure it is worth the wait.

  3. Back to top

    Re: Loading time way too slow

    Jun 16, 2008 10:49 AM by R.J. Lorimer

    It takes too long time for the applet to appear (on a dual core 2.8 ghz, 2gig ram). I first thought that it did not work at all and left the page, since all I saw was an empty page. I later tried it again and the applet appeared after 1-2 minutes. A loading indicator would be needed for this to avoid confusion. Anyway, I am not sure it is worth the wait.
    José, I agree the wait time is pretty dismal. I think the hope/expectation is that the consumer JRE will fix the majority of this. There is a BETA of the consumer JRE available now; admittedly I haven't tried it, but it is supposed to dramatically improve the startup experience. Time will tell if it is enough.

  4. Back to top

    Swing RIA already exists it just needs support

    Jun 16, 2008 2:46 PM by Gary Thompson

    I'm all for anything that promotes Java and Java Applets but API's and products already exist, AltioLive is one such product.

    I'm a little biased on this as I am head of technology at Altio, and have often wondered why existing products and API's don't get the support of the development community. Is it a case of "not invented here"?

    As much as I would rather see the community writing controls for AltioLive support for Pivot is a good thing as it makes everyone aware of what Java and Java Applets can really achieve. I look forward to seeing new features and articles and with Java 6 update 10 maybe we will see more consumer based applets rather than only seeing them in the enterprise.

  5. Back to top

    Re: Swing RIA already exists it just needs support

    Jun 16, 2008 2:53 PM by Gary Thompson

    Web reference for previous post should be www.altio.com

  6. Back to top

    No offense

    Jun 16, 2008 4:01 PM by Richard L. Burton III

    Applets were dead years ago. They had their moment back in 1998 or 1999, but dear lord let them die. Why even waste your precious time working no something so barbaric as this? Well, support OpenSource and not OpenSores. Best regards, Richard L. Burton III

  7. Back to top

    Re: Loading time way too slow

    Jun 16, 2008 6:51 PM by Greg Brown

    The poor load time may also be due, in part, to the servers at java.net. They are not always as responsive as they should be.

  8. Back to top

    Re: Loading time way too slow

    Jun 17, 2008 9:32 PM by Jeff Thorne

    I just tried the demo applet. It did take some time to load but when we compare it to the load time of some Ajax or flash apps it seems to been at par with other RIA technologies. I think Pivot is taking a step in the right direction. Applet technology may be down but I don't think it is down and out. Projects like Pivot could very well make applets viable again. Keep up the great work.

  9. As soon as I have learned that Pivot does not depend on Swing, I have tried to compile it natively in the hope that the Java Runtime Slim-Down model would deliver substantial reduction in download size and disk footprint. However, it turned out that it is AWT that depends on Swing!

    I was still able to produce a JRE-independent PivotDemo installer smaller than 10 MB and taking 34.6 MB when installed, compared to JRE 1.6.0_03 taking 13.9 MB and 79 MB respectively. Could have been better if I could leave out Swing.

Educational Content

Bindings, Platforms, and Innovation

This presentation focuses on the Internet and separating myth from fact, history from the future, and the mundane from the imaginative. Bob Frankston presents a vision of what could and should be.

Orchestrating Long Running Activities with JBoss / JBPM

This article explores the use of JBoss and jBPM to implement design solutions that effectively address the issue of orchestrating long running activities.

Neo4j - The Benefits of Graph Databases

This presentation covers the use of graph databases as an optimal solution for data that is difficult to fit in static tables, rapidly evolving data or data that has a lot of optional attributes.

Realistic about Risk: Software development with Real Options

This session introduces Real Options and shows how it can help in running your project. Real Options is a decision-making process that can be used to manage risk.

Communication Flexibility Using Bindings

This article discusses the use of bindings on services and references (including the instance of non-configured bindings) as the means to implement SCA communications in a Web and SOA environment.

Writing DSLs in Groovy

After a short introduction to DSLs, Scott Davis plays with the keyboard showing how to approach the creation of a DSL by typing working snippets of Groovy code that get executed.

Scaling Agile with C/ALM (Collaborative Application Lifecycle Management)

IBM Rational and InfoQ present, Scaling Agile with C/ALM, an eBook showing organizations how to become “finely tuned software delivery machines” by enabling team integration and scaling.

Concurrent Programming with Microsoft F#

Amanda Laucher presents a real life enterprise application written in F#. She shows actual code snippets, explaining design decisions and suggesting how to use some of the F# constructs.