Sponsored Link •
Simon Phipps blogs about the marriage of Java applets and AJAX, suggesting that AJAX applications could benefit from having access to the rich Java APIs. But would the marriage of AJAX and Java applets turn out harmonious, or end in divorce?
In his blog, Simon Phipps comments about a demo that Francois Orsini, Sun's Java database lead, gave at ApacheCon. The demo allows JavaDB—Sun's version of the small-footprint open-source Java database also known as Apache Derby—to persist data created in an Ajax application. Francois himself described the demo as follows:
It was all driven from the application scripting logic interacting directly with a
What might they do? Some obvious things, like encryption, compression, validation and so on. But also some more interesting things are possible. How about a tiny Jabber server so the applet can use the local IM client as a log or command prompt? Perform XML transforms (in conjunction perhaps with WADL) for multi-host compatibility? An embedded web server as per Mark McLaren? And of course, a local SQL database.
If invoking Java objects from an AJAX application became a real alternative, AJAX apps would suddenly have access to the entire Java API, including many third-party libraries. It has taken Java ten years and huge investments of money and labor to get to where it is, and it's hard to imagine that AJAX will provide a rich environment in the near future comparable to what Java has to offer today.
But are such background applets a real alternative? I always felt that the biggest problem with applets was their implementation—slow startup, incompatible behavior across browsers and platforms, and the need for users to potentially download a huge JRE to upgrade to the appropriate Java version.
It turns out that J2SE 5 already addressed many of these issues: Java WebStart and the Java Plugin now use a common architecture and implementation that allows seamless JRE updates and fast client-side caching of Java code. Applet startup time is still generally a problem, but some of that may be addressed in Java 6.
Simon's blog post hints at using Java applets in conjunction with AJAX—but what role would AJAX play in such a marriage? It's nice to persist HTML form data via an embedded Java database, but once we've incurred the applet startup time, why not display a Swing form that provides all the nice usability features that folks have invested time to design and implement over the past decade? Or use one of the Java look-and-feels to make the form look polished?
What role do you think a combination of AJAX and Java applets have on the client, if any? Will AJAX completely replace client-side Java? Or will AJAX and client-side Java co-exist, but in different applications, possibly even in different application domains?
|Frank Sommers is a Senior Editor with Artima Developer. Prior to joining Artima, Frank wrote the Jiniology and Web services columns for JavaWorld. Frank also serves as chief editor of the Web zine ClusterComputing.org, the IEEE Technical Committee on Scalable Computing's newsletter. Prior to that, he edited the Newsletter of the IEEE Task Force on Cluster Computing. Frank is also founder and president of Autospaces, a company dedicated to bringing service-oriented computing to the automotive software market.
Prior to Autospaces, Frank was vice president of technology and chief software architect at a Los Angeles system integration firm. In that capacity, he designed and developed that company's two main products: A financial underwriting system, and an insurance claims management expert system. Before assuming that position, he was a research fellow at the Center for Multiethnic and Transnational Studies at the University of Southern California, where he participated in a geographic information systems (GIS) project mapping the ethnic populations of the world and the diverse demography of southern California. Frank's interests include parallel and distributed computing, data management, programming languages, cluster and grid computing, and the theoretic foundations of computation. He is a member of the ACM and IEEE, and the American Musicological Society.