Is Java more efficient than Ajax for advanced web apps?

by Hari K. Gottipati

Google is looking at Java based online office suite despite of having Docs & Spreadsheets!

Computerworld reviewed online office suites Ajax13, Google Docs & Spreadsheets, ThinkFree Office Online and Zoho Office Suite . The winner is ThinkFree and the runner is Zoho, same as I mentioned in my previous blog Google is not the leader in Ajax applications.

The reason to pick ThinkFree was:
It looks more like a full application: menus, a rich toolbar, a ruler bar and even a drawing toolbar similar to Word's for inserting elements such as AutoShapes, text boxes, clip art, and pictures.
In fact, ThinkFree's Power Edit menu reveals a startling number of word processing features, from columns and drop caps to AutoCorrect and table manipulation, such as merging cells, distributing cells evenly across the page, repeating header rows.
ThinkFree hides your browser's menu bar, so when you use familiar keyboard shortcuts (such as Alt+F, O for File/Open), you are operating within the ThinkFree interface, not your browser. Other similarities to Microsoft Office are downright eerie -- the charting wizard in ThinkFree Calc looks just like Excel's and supports all of Excel's chart types.

Think free offers their word processor in two flavors: Quick Edit and Power Edit. Quick edit is Ajax version of the editor which offers a minimal interface -- a few toolbar buttons for simple editing and some other features. All above features(listed in block quote) are only available in Power mode which is Java(applet) based. They used Java for more complex functions and for deeper Microsoft compatibility. However, initially the Power Edit takes time to load as it has to download the applet.
So the question is, why can't they support all Power Edit(Java) features in Quick Edit(Ajax)? According to ThinkFree CEO TJ Kang:
Currently the best way to offer advanced Web Office functionality is to utilize Java. Ajax doesn't cut it when it comes to advanced functionality. Although in theory you can build it in Ajax, the resulting code will be so big that it will take ages to download stuff and slow the system considerably. So Java is, much more efficient than Ajax when it comes to implementing Microsoft Office-like functionality.

Since they have both Ajax and Java versions, I don't think his comments are biased towards Java. At the same time don't forget that initial download time of an Applet is significant and browser needs a Java plugin.

In other prospective, Google is not in the top 2 list of the online office products, because:
High-end documents don't render properly because Google Docs isn't 100% Word-compatible, nor does it claim to be.
Google Spreadsheets has a few compatibility issues with Excel (array formulas aren't supported, for example), and its lack of charting support is a disappointment.
However, even Google Inc. may be ready to admit that its office applications aren't ready to take on Microsoft.


For Google, its clear that it cannot compete with the Microsoft with its Docs & Spreadsheets. Unless they support all MS office features, it's difficult for Google to win the race. Perhaps, it's difficult for them to support all the functionality and MS office compatibility with their current approach(Ajax). So here are the options for Google to win the race:
1. Support all the functionality with Ajax even though the resultant code is going to be big and ages to download
2. Despite of initial download time, rewrite online office suite utilizing Java .
3. Buy ThinkFree

Guys, what you think? Based on Google's recent acquisitions, do you think that their option will be 3? You are right, they are already in talks with ThinkFree.
Google is reportedly in talks with a South Korean software company and its US subsidiary ThinkFree, which makes browser-based office productivity software compatible with Microsoft file formats.
ThinkFree is a subsidiary of Haansoft, which is based in Seoul. Haansoft's CEO, Baek Jong-jin, said he met twice this month with Google's corporate development team responsible for the $1.65 billion acquisition of YouTube, the English-language newspaper Korea Times reported on Sunday.


I think definitely this move is adding fuel to the ThinkFree's Java approach. But I believe both have advantages & disadvantages and it depends on what functionality you are trying to achieve it. For example, Java makes life easier to do image handling and animations. On the other hand, ajax is much faster and no plugin is needed. So if your web app is going to have much advanced features such as image handling etc. definitely Java is more efficient than Ajax.

What do you think? Do you agree with ThinkFree CEO TJ Kang? Do you think Google realized that they cannot achieve the advanced functionality with Ajax? Or do you think they are talking with ThinkFree as a part of their acquisition strategy? If you know any Java apps that are powerful than Ajax apps, please add in comments.

Update 1: Fellow blogger Paul Browne wrote 'Do Google Spreadsheets mean the end of Java?'. Please do remember that he is talking about the server side Java and I am talking about the client side Java(Applets).
Update 2: Trimmed the title as per Tim's suggestion. Thank you Tim.

21 Comments

Tim O'Brien
2007-01-19 13:05:39
Heh. The first choice after AJAX is Flash followed by (maybe) Java, but applets on retail sites is an absolutely productivity killer. Applets are a non-starter.
Jess Sightler
2007-01-19 14:43:47
Yeah, applets are a non-starter.


Except for Thinkfree, which is actually really good.

Hari K Gottipati
2007-01-19 16:09:14
@Tim O'Brien,
I agree with you. Flash will be the first choice after Ajax. ThinkFree is already working on the Flash version for its power mode.
Luke deGruchy
2007-01-19 21:50:14
Some are speculating that once Java is 100% open source (including the class libraries), that the Mozilla foundation might bundle Java directly into Firefox, instead of including it as a plugin. This could address at least part of the issue with the JRE load time for applets.
Hari K Gottipati
2007-01-19 21:56:29
@Luke deGruchy,
If it happens, its going to be good news for Java community!!!
JT Wenting
2007-01-22 00:15:56
Who said anything about applets?
WebStart is far more efficient and Java applications can communicate with servers to read and write documents.
No more need for browserbased solutions.


Wait, didn't we hear that before? Are we on the return again away from the "everything is a webapp" hype?
First there was the mainframe with the dumb terminal.
Then came the client/server solution.
Next there was the webapp, relieving sysadmins of having to keep their thousands of workstations synchronised and turning the PC into a dumb terminal.
Now we're swinging to the rich client talking to a server using webservices, in other words a client/server solution, because the web application was found not to offer a rich enough user experience.

John C. Walker
2007-01-22 05:58:31
JT Wenting makes THE observation with "are we on the return again away from the 'everything is a webapp' hype?"


It was a decade ago when Sun introduced version 1.0 of the Servlet specification which gave software engineers the ability to create applications using just HTML and JavaScript.


As a sharp contrast to the network piping available then, today the broadband penetration rate is 80% among Internet users and the "YouTube" generation now gobbles significant bandwidth for entertainment. Meanwhile we continue to try to architect software that will fit within only a few bytes across the wire.


2007 will represent the year where software engineers begin to revisit their original assumptions about the web and recognize that in targeting software for the future it is prudent to explore thin rich clients such as applets and those delivered by Java Web Start which are more development and maintenance friendly than shoe-horning HTML and JavaScript into an application.

Michael
2007-01-23 10:34:38
The first choice after AJAX is Flash followed by (maybe) Java, but applets on retail sites is an absolutely productivity killer. Applets are a non-starter.


I'm curious about why that is. Why does flash load faster than Java?

Valery
2007-01-23 13:01:44
@Michael
I'm curious about why that is. Why does flash load faster than Java?


1. Flash 9.0 is 1 Mb, JRE is ~10Mb
2. Flex applications (Flex is UI framework for Flash business applications) have more convinient built-in packaging options then Java: merge all relevant code into single SWF; use several SWF applications and shared libraries; use several applications with programmatically loaded modules. In any of these options only necessary classes are packaged at build time -- unlike Java where typically you have to download 500K jar even if you need only 2-3 classes (say, 10K of bytecode)

JT Wenting
2007-01-24 00:23:38
Be as it may Valery, but that smaller initial install does mean that that Flash app is several times larger than the equivalent Java applet because it needs to link in (and thus download every time) a lot more libraries than that applet would.
That's the tradeoff Flash makes, larger repeat downloads for a smaller initial one.
In the end the user requires more bandwidth to do the same thing (unless he never clears his browser cache and the Flash app is never updated on the server with as much as a new timestamp).
Hari K Gottipati
2007-01-24 21:03:53
@Valery,
Sun is working on Java, browser edition(Fully compatiable with J2SE) which is the subset of Java that your particular program required. Like flash, it only packages the required classes and downloads all of the other functionality on demand. The initial results are encouraging, but still can't beat Flash in the size!!! Here are the results:
Java 6 Runtime Environment: 15.5MB
"Hello World" JRE: 2.6MB
java.awt.Frame JRE: 3.5MB
Hari K Gottipati
2007-01-24 21:33:45
I forgot to add the link to Java browser edition, here it is:
http://weblogs.java.net/blog/enicholas/archive/2006/09/java_browser_ed.html
Doron Barak
2007-01-25 06:16:00
Correct me if I'm wrong but can't you decompress all the JAR/ZIP files your applet requires down to the class/resource level and then leave that on your server, or even redirect class/resource request directly to a Servlet so that the client loads just the requested classes as they are needed by the applet... is that not faster in the overall and also uses less bandwidth because you're not loading megabytes worth of classes you're not going to use?
Valery
2007-01-26 13:55:22
@JT Wenting
You are partly right. If user agrees to have JRE pre-installed then Java applets always win. If it's necessary to install both run-time and application, then Flex wins for certain number of applications; the more applications user loads, the less Flex wins. And when total_size_of_applications > JRE_size - Flash_size point applets solution wins again.


However, practice shows that it's more attractive option to eat user bandwidth in long run rather then at start-up of application (classic pre-Ajax web applications do exactly this). So Flex is more attractive option.


Btw, if all applications are controlled by same vendor then 14.5 MB is approximate size of 10 to 20 quite complex Flex business applications. Do you have 10-20 Java applications (as applets) in JRE cache?


Valery

Valery
2007-01-26 14:00:26
@Hari K Gottipati


Yep, still not impressive numbers.
The recent Flex application I worked with is a report editor that helps user to create/customize reports based on some database data. Reports have configurable grouping, formulas (even with aggregate functions), sorting, filtering, format tweaking, printing etc. Size of application: less then 800K. It's Flex.


Valery

sa
2007-01-29 03:30:46
dfd
Marc
2007-01-29 16:49:25
@Valery


IMO what makes applets so much less appealing than Flash is the start-up time.
It just takes ages for Java to initialize!

JT Wenting
2007-01-30 00:31:14
For people on dialup (still the majority of the world) the startup time for the JVM is nothing as compared to the cost (and time) spent to download all the duplicate code for Flash stuff every time they launch it.


And on modern browsers and JVMs that startup time is incurred only once per browser session, not for every applet being loaded (while the recurring download of Flash libraries IS repeated for each instance of the Flash application).


I've over the last 2 weeks received 2 new PCs from 2 different manufacturers. Both came with a 5.0 JRE preinstalled. While a small sample both were major brands (Toshiba and HP), and I know other major brands do the same.
So we can likely safely assume that most people who purchase a new PC will have a preinstalled modern JRE out of the box (and included in their recovery image if they need it), removing the "big initial download" argument for them.


But Java has this ancient image of being slow and cumbersome, with bad looking AWT user interfaces.
And that's the main hurdle against an increasing acceptance of applets among web developers (the end user doesn't usually get a choice, so his preferences aren't important, only the perception of those preferences by the web authors and their bosses are), kept in place in part by the hostility towards Java (fueled by an ingrained hatred against anyone making money from computing) in the Linux world.

Chris Nystrom
2007-02-06 07:13:47
We need something like my own NewIO (http://www.newio.org).
Steve Kalvi
2007-02-19 14:06:53
Has anyone checked out the Java Video example. It uses scripting language called F3. The examples are pretty amazing.



http://blogs.sun.com/chrisoliver/

Venkateswara Rao
2007-07-05 02:56:02
Did any one check this good demos ...Check them


https://swinglabs.dev.java.net/