Blogadda

Blogadda
Visit BlogAdda.com to discover Indian blogs

Friday, June 12, 2009

Apache Pivot

What is Apache Pivot?

Apache Pivot is an open-source platform for building rich internet applications in Java. It combines the enhanced productivity and usability features of a modern RIA toolkit with the robustness of the Java platform. Pivot applications are written using a combination of Java and XML and can be run either as an applet or as a standalone, optionally offline, desktop application.

Like other modern development platforms, Pivot provides a comprehensive set of foundation classes that together comprise a "framework". These classes form the building blocks upon which more complex and sophisticated applications can be built.

Who is Pivot's target audience?

Pivot was designed to be familiar to web developers who have experience building AJAX applications using HTML, CSS, and JavaScript. However, it provides a much richer set of standard widgets than HTML, and allows developers to create sophisticated user experiences much more quickly and easily. Pivot will also seem familiar to Swing developers, as both Swing and Pivot are based on Java2D and employ a model-view-controller (MVC) architecture to separate component data from presentation. However, Pivot includes additional features that make building modern GUI applications much easier, including declarative UI, data binding, effects and transitions, and web services integration.

Why RIA?

The web has become the defacto standard method for application delivery. However, functional requirements for web applications have begun to scale beyond the capabilities of the browser. Even with the addition of scripting support, dynamic element manipulation, and asynchronous server communication, it is difficult to create a user experience in HTML that is truly on par with that of a desktop application.

Rich internet application (RIA) development platforms are a means of bridging the gap between the web and desktop experiences. Using browser plugins, these platforms allow developers to build applications that look and feel more like native desktop applications but are deployable via the web, like traditional, HTML-based web applications. RIAs also often incorporate visual effects intended to enhance the overall user experience, such as animations and other dynamic behavior.

Adobe Flex and Microsoft Silverlight are arguably the most high-profile of these platforms; others include OpenLaszlo and Curl. Pivot itself falls into this category.

Why Pivot?

Pivot was created for two primary reasons:

  • To provide a viable option for developers who want to build rich client applications in Java. Flex applications are written in ActionScript, an ECMAScript variant; Silverlight applications can be written in either C# or JavaScript; OpenLaszlo applications are written in JavaScript. Pivot allows developers to write rich internet applications in Java (or any other language that can run in a JVM).
  • To provide a freely-available, open source alternative for RIA developers. Flex, Silverlight, and Curl are all proprietary platforms. We believe that a large part of HTML's success was its due to its openness. While we certainly hope that developers will use Pivot to build revenue-generating products and applications, we believe that the platform itself should be free and driven by its technological merits, not by corporate objectives.

Where did Pivot come from?

Pivot began as an R&D effort at VMware in 2007. It was announced as an open-source project in June of 2008 under the Apache 2.0 license. Version 1.0 was released in October, 2008, and version 1.1 in April, 2009. Work is currently underway on version 1.2, scheduled for release in mid 2009.

What platforms does Pivot support?

Pivot applications run on any operating system with a Java Virtual Machine (JVM) version 5 or greater. They can be run locally as Java desktop applications or via the web using the Java plugin.

Who is developing Pivot?

Pivot has been developed primarily Greg Brown and Todd Volkert of VMware. However, it is a community-driven effort that has recieved contributions from a number of developers around the world. An RIA platform is a large undertaking that needs the support of a larger developer base if it is to succeed and thrive. Interested developers are encouraged to participate; information on how to do so is available on the Pivot home page.

How does Pivot compare to Swing?

While it is technically feasible to build an RIA in Java using the Swing toolkit, Pivot offers a number of advantages that make it a more compelling, modern alternative:

  • Pivot provides an XML markup language called WTKX for simplifying user interface construction. Flex, Silverlight, and OpenLaszlo all offer a similar feature; web developers are comfortable with the markup metaphor, and it can considerably reduce overall development time.
  • Components are not limited to an "atomic" preferred size; they are allowed to report a preferred size as constrained by either width or height - this facilitates such features as label wrapping, which Swing does not support.
  • Pivot employs a consistent data model that is used throughout the entire framework; for example, JSON data returned from a REST service is serialized into the same data structures used by a table view component to present data. No additional translation is necessary, which can significantly improve performance. A common data model also reduces the learning curve for new developers.
  • Pivot includes built-in support for REST-based data services, which Pivot calls "web queries". This provides parity with Flex, which comes with out-of-the-box support for RPC via the AMF protocol, and Silverlight, which supports both SOAP and REST-style services. Swing does not include any built-in facilities for server communication, making it less convenient to work with.
    Note, however, that Pivot is not limited to REST for server communication. Because it runs in a JRE, a Pivot application can take advantage of any client/server protocol that has a Java API; for example SOAP-based services via Axis or Flex RPC using the BlazeDS AMF client.
  • Pivot includes built-in data binding support, which allows data returned from web queries (as well as other types of data services) to easily be mapped to form contents.
  • Pivot includes (and takes advantage of) platform-level support for visual effects and transitions (i.e. animations).
  • Pivot applications are inherently resolution independent. Bitmapped and vector images are interchangeable, and the entire user interface can be scaled to take advantage of high-resolution displays or for accessibility purposes.
  • Pivot defines a single Application inteface that is used for launching both desktop and web-based applications - multiple codebases for applets and applications are not required.
  • Because it requires Java 5, Pivot is able to take advantage of newer Java language features such as generics, enums, for..each loops, and annotations.

How does Pivot compare to JavaFX?

Fundamentally, Pivot and JavaFX appear to be serving two different use cases. Pivot is designed primarily to address the "Application" in "RIA", whereas JavaFX appears to be geared more towards the "Rich" part of the acronym. This isn't to say that the two are mutually exclusive - Pivot supports a variety of features for adding visual richness to an application. However, Pivot is first and foremost a tool for creating applications - animations and other effects are primarily intended to enhance the user experience of those applications, not serve as simple eye-candy.

Pivot additionally differentiates itself from JavaFX by allowing developers to build applications in Java, rather than the JavaFX scripting language. Finally, JavaFX's widget support is based on Swing, which suffers from the limitations outlined above.

In a sense, Pivot represents what we think Sun should have done instead of JavaFX.

How does Pivot compare to the Google Widget Toolkit (GWT)?

While GWT allows developers to use the Java language to write web-based applications, the runtime enviroment for a GWT application is the browser itself, not a JVM. This has a number of drawbacks:

  • The compiled code executes as interpreted JavaScript, not bytecode.
  • The only libraries available are those that have been ported to GWT by Google.
  • All presentation must be done via CSS and DOM manipulation rather than via a true 2D drawing API.
  • Additionally, GWT does not support an XML markup language - all UI elements must be created programmatically.

Pivot allows developers to efficiently construct RIAs that can truly take advantage of the Java platform.


No comments: