|By Jim Inscore, May 2006|
Sun Microsystems may be most identified with the server side, but it has a long history on both sides of the client-server equation. Remember Java applets in browsers? The history of Java technology includes a number of initiatives to enrich the client with more dynamic content: Java Web Start software, Java Servlets, and JavaServer Pages and JavaServer Faces technology, among others.
Eduardo Pelegri-Llopart is a Sun Distinguished Engineer and a longtime contributor to Java technology in the enterprise. He developed the first JavaServer Pages specification and was central to the development of the original Java Platform, Enterprise Edition (Java EE, formerly referred to as J2EE).
Vivek Nagar is the technology director for (Ajax)/Web 2.0 in the Enterprise Engineering group at Sun. A member of the original engineering team for the Java EE platform, Nagar has recently been involved in developing Sun's identity products.
Greg Murray is a founding member of the Java BluePrints team and has contributed to Sun's Java web-tier architecture and best practices for more than five years. He has been driving a new set of best practices with Ajax in the BluePrints Solutions Catalog.
As part of this initiative, Sun is also launching two new developer portals:
What's the big deal about (Ajax)? Why all the buzz?
Pelegri-Llopart: The reason Ajax is a big deal now is that the combined set of technologies included in (Ajax) deliver additional value to end users. The bottom line -- the motivation for developers -- is that the experience of AJAX-powered sites is better.
People who build web sites are competing for eyeballs, customers, so a better user experience wins. (Ajax)-enabled sites help deliver an experience in the browser that's close to a desktop application.
Nagar: I think the big reason Ajax is getting really popular these days is that it brings lots of interactivity to the web. Rich clients were much more capable of interactivity, where web content depended on a page-refresh model.
(Ajax) effectively removes the problems associated with the traditional click-and-wait web application models and allows web applications to provide the responsiveness and interactivity associated with desktop-based rich clients.
Pelegri-Llopart: These enhancements to the user experience can take many forms: activity within a page -- for example, a pop-up calendar -- without refresh. Or take the much more sophisticated Google and Yahoo maps, where you get a very smooth scrolling experience refreshing the image on the fly. It feels like you are actually navigating through the landscape without the need to download a whole client application. You get very sophisticated behind-the-scenes activity supported by both the client and the server.
Murray: Ajax definitely has buzz right now, but it might not be right for everyone or every web project. (Ajax) is limited to the latest browsers, and it exposes some browser-compatibility issues. It may also require new skill sets for many people.
On the other hand, you can achieve highly interactive rich web applications that are responsive and appear really fast. It may be debatable whether an Ajax application is really faster, but the user feels a sense of immediacy, because he or she gets active feedback while data is exchanged in the background.
But the main difference of Ajax is the first letter: asynchronous. Rather than requesting a whole page at a time, an (Ajax) application makes asynchronous requests using XML-enabled browsers to update managed portions of the page. It's this mechanism that makes truly responsive UIs (user interfaces) possible.
Pelegri-Llopart: One value of an acronym is that once people can name something, they can talk about it.
Part of what contributes to Ajax as a solution are the other evolutions in capabilities. We've talked about better browser compatibility. Also, bandwidth today is broad enough that developers can deliver live interactive experiences without leaving behind a larger potential audience. Of course, CPU performance and additional memory in client machines makes them powerful enough to do the real-time processing necessary.
The bar of interactivity experience has been raised so that now you have to have a really compelling user experience. And that's the kind of experience that Ajax enables.
So you have Ajax on the client side and Java technology on the server. How do you get them working together?
Pelegri-Llopart: Java technology is completely compatible with (Ajax), and most AJAX-enabled web sites use Java technology on the server side. Request processing from an Ajax client happens on a Java server, and the rendering sent back to the client happens on a Java server. Java technologies, like Servlets and JavaServer Pages, can be used to generate plain old HTML or HTML that is AJAX-enabled.
Murray: One of the things that the BluePrints team brings to the game is experience with best practices for Java technology-based web applications. We've started collecting and disseminating our best practices for using Ajax and Java technologies together. In fact, the BluePrints Solutions Catalog is morphing to include more and more best practices for building highly interactive web experiences using (Ajax), JavaServer Faces components, and other Java platform-based tools and technologies.
Pelegri-Llopart: We should also mention the relationship between Ajax and Java technology on the client side. It's still possible to write a map manipulation program as a Java application, then use Java Web Start software to deliver it as a stand-alone application. Or you can choose -- as Yahoo has -- to write a map manipulation program in a browser using (Ajax). There are always going to be trade-offs, and there will always be situations in which a developer will closely evaluate these options.
The buzz around Ajax has been building for a while now. Is Sun late to the Ajax game?
Pelegri-Llopart: We've been tracking and working on this technology for quite a while at Sun. It's fair to say that we haven't made enough noise about our efforts, but Java BluePrints, for example, has been releasing stuff since at least the 2005 JavaOne conference.
Murray: We were also the first big vendor to do anything with (Ajax). We pushed out the BluePrints Solutions Catalog with Ajax in it in May 2005. We had a big splash at last year's JavaOne conference and articles on it in June. Many of the other larger companies didn't wake up to AJAX or publish anything until late last year. That said, we haven't created much for AJAX infrastructure other than defining the programming options and showing the JavaServer Faces programming model, but we're working on that.
Nagar: Besides providing guidance to developers to (Ajax)-enable their existing Java technology-based applications, Sun is providing a set of AJAX-enabled components integrated with Java technologies and tools. In addition, Sun has been working on providing better support for Ajax within future versions of the Java platform technologies.
Pelegri-Llopart: Well, the two languages have always inhabited different niches in the ecology of languages. The same developer may use one language in one case and another in the other.
The Java programming language is a static language intended to provide very productive performance, structured programming, high maintainability, and extensibility through object orientation, encapsulation, and so on.
Pelegri-Llopart: Yes, it's a story we've been building up for the last two years or so. It revolves around more clearly distinguishing between Java -- the language -- and Java -- the platform. For historical reasons, both have the same name, but the Java platform is a set of libraries that can be manipulated with different languages. Although the Java language is closely tied to the Java platform, there are now ways to provide scripting language access to those.
Nagar: Rhino running on the Java VM -- one of the features of Java SE 6 -- is supported through the JSR 223 framework that lets you plug in multiple dynamic languages similarly. Of course, with scripting enabled in the base platform, derivatives like the next-generation Java EE platform will be able to take advantage of these capabilities as well.
Murray: To look into the future of scripting language support on the Java platform, all you have to do is check around the Internet. Some interesting projects include Rhino, Groovy, BeanShell, JRuby, Jython, Tcl, and others. So the community is interested in scripting on the Java platform. There's a good list of scripting languages at Java-Source.net. This list will grow with the release of Java SE 6.
Pelegri-Llopart: In the longer term, we want to use scripting not just on the Java SE platform but with the Java EE platform. We see a natural affinity between time-to-market requirements of the web tier, where many user interfaces have a short lifespan in which to look fresh and up-to-date, and scripting solutions on both the client and the server. Where application longevity is less of an issue, there are real productivity advantages to being able to quickly assemble applications using scripting language.
What are Sun's offerings in Ajax for the different developer audiences you're targeting? Who do you see using this stuff?
Nagar: Sun provides developers with a comprehensive set of technology, tools, and guidance for developing and deploying (Ajax)-enabled applications.
For example, we were the first to market with a visual tool for Java technology and web developers, Java Studio Creator IDE. The launch of Creator 2 in January 2006 gave Java technology developers an easy-to-use tool, plus a rich set of JavaServer Faces components, many (Ajax)-enabled, available free for download. And we plan to enhance and expand the pool of AJAX-enabled JavaServer Faces components over time.
Of course, as Greg Murray mentioned, we're offering an expanding BluePrints Solutions Catalog of best practices for designing and implementing rich interaction on the web.
In the future, you'll see enhancements to tools like the NetBeans IDE and better support in our runtime environments, including Application Server and Portal Server. Our intention is to fully integrate Ajax technologies into our Java tools and Java platforms.
We are also looking at possibilities for partnering with some communities out there, some initiatives that we're interested in that we may align with or join forces with.
We are working on a set of Ajax components -- jMaki -- to target both the visual web design and the hardcore Java developer audiences. The general developer view would be the Java tag handler interface -- the simple events-based scripting model. Developers who want to dig in their heels on harder enterprise problems can manipulate the scripts and templates through the Java models, accessing web-tier functionality with JavaServer Faces and JavaServer Pages technology and accessing enterprise features through EJB and other APIs.
The Java Studio Creator IDE is positioned as the hot tool for building JavaServer Faces applications, but it's not clear that JavaServer Faces has won the web frameworks/architecture battle. How can Ajax and JavaServer Faces technology work together to move the ball on that issue?
Pelegri-Llopart: Well, there are two sides to that question. First, it's clear that Ajax on its own or with other frameworks may be the right solution for some developers.
Murray: We intend to announce the jMaki Ajax components by the JavaOne conference. They will be highly usable outside of JSF. These are (Ajax) widgets that you can use outside of JSF. The rich component model can be used in a variety of tools.
Pelegri-Llopart: What JavaServer Faces does well is manage and hide certain complex client activities like callbacks to the server.
Murray: We published an article on java.net almost a year ago about the synergies between JavaServer Faces and (Ajax), and we'll be refreshing it soon as part of our efforts to support developers.
So how would a developer go about deciding between the array of toolkits and frameworks available for building (Ajax)-enabled clients?
Pelegri-Llopart: The landscape will continue to change because we're close to the bleeding edge. You have to choose in part based on technical merits, in part based on the vendor -- who they are, where their alignment is. Be prepared to mutate over time. What tools are you using now? If you want a visual tool, use Java Studio Creator IDE. It's a good place to start, a good tool to learn, and it's from a reliable vendor.
Murray: We like the Dojo toolkit. It contains an intelligent packaging system, UI effects, drag-and-drop APIs, widget APIs, event abstraction, client storage APIs, and Ajax interaction APIs. Dojo solves common usability issues such as support for dealing with navigation, for instance, the ability to detect the browser's Back button.
There's more on most of the issues about choosing and using Ajax in our (Ajax) FAQ.
Will we see more about Ajax and scripting from Sun at the 2006 JavaOne conference?
Nagar: Sun will be talking about initiatives that provide better support for Ajax in the Java platforms, tools, and technologies.
Murray: We've definitely got some things we think developers will latch on to. The BluePrints team, the Java Studio Creator IDE team -- we'll talk about some interesting open-source and community projects.
Pelegri-Llopart: We'll have some news -- that's for sure.
(Ajax) FAQ for the Java Developer
(Ajax) hub page
Using JavaServer Faces Technology With (Ajax), by Greg Murray, Tor Norbye, and Ed Burns
Java Studio Creator IDE
JSR 223: Scripting for the Java Platform
Java EE platform
Java SE 6
*As used on this web site, the terms "Java virtual machine" or "JVM" mean a virtual machine for the Java platform.