InfoQ

InfoQ

News

My Bookmarks

Login or Register to enable bookmarks for unlimited time.

The content has been bookmarked!

There was an error bookmarking this content! Please retry.

Pivot: Re-Inventing the Java Applet?

Posted by R.J. Lorimer on Jun 15, 2008

Sections
Development
Topics
Java ,
Rich Client / Desktop
Tags
GUI ,
MVC
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
Loading time way too slow by José Jeria Posted
Re: Loading time way too slow by R.J. Lorimer Posted
Re: Loading time way too slow by Greg Brown Posted
Re: Loading time way too slow by Jeff Thorne Posted
Swing RIA already exists it just needs support by Gary Thompson Posted
Re: Swing RIA already exists it just needs support by Gary Thompson Posted
No offense by Richard L. Burton III Posted
Natively compiling PivotDemo reveals AWT dependency on Swing by Dmitry Leskov Posted
  1. Back to top

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

    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 : soa2world.blogspot.com/">

  2. Back to top

    Loading time way too slow

    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

    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

    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

    by Gary Thompson

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

  6. Back to top

    No offense

    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

    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

    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. Back to top

    Natively compiling PivotDemo reveals AWT dependency on Swing

    by Dmitry Leskov

    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

10 tips on how to prevent business value risk

One category of risk that project teams need to ensure they address is business value failure – delivering a product that fails to provide value for the business investor.

Interview: Software Systems Architecture: Working With Stakeholders Using Viewpoints and Perspectives

InfoQ spoke to the authors of Software Systems Architecture on a couple of new topics, the System Context viewpoint and Agile, which have been added to the second edition.

Beauty Is in the Eye of the Beholder

Alex Papadimoulis discusses ugly code, where it comes from, how to avoid it, and how to get rid of it.

Architecting Visa for Massive Scale and Continuous Innovation

John Davies examines Visa’s architecture and shows how enterprises have architected complex integrations incorporating Hadoop, memcached, Ruby on Rails, and others to deliver innovative solutions.

Max Protect: Scalability and Caching at ESPN.com

Sean Comerford unveils ESPN.com’s architecture, what components are used and why, and the current changes the website goes through.

The Seven Deadly Sins of Enterprise Agile Adoption

Are there repeated patterns of failure on Enterprise Agile Enablement efforts? Sanjiv and Arlen discuss Seven Deadly Sins to avoid when adopting Agile in an enterprise.

Questions for an Enterprise Architect

Erik Dörnenburg answers: What is Enterprise and Evolutionary Architecture?, discussing 4 issues: Turning strategy into execution, Ensuring conformance, Where do the architects sit? Buying or building?

Wrap Your SQL Head Around Riak MapReduce

Sean Cribbs explains what Map-Reduce and Riak are, why and how to use Map-Reduce with Riak, and how to convert SQL queries into their Map-Reduce equivalents.