The Design of Software (CLOSED)

A public forum for discussing the design of software, from the user interface to the code architecture. Now closed.

The "Design of Software" discussion group has been merged with the main Joel on Software discussion group.

The archives will remain online indefinitely.

Why AJAX instead of Java Applets?

Can anyone tell me, from a best practices point of view, why anyone would want to implement a Web app using AJAX, instead of as a Java applet talking to a back end server?

Seriously. It seems to me that if you have to warn your users not to hit the Back button on the browser you're maybe using the wrong software platform. But that's just me.

Here's a choice quote:

http://www.ajaxinfo.com/default~viewart~8.htm

"Disadvantages: Requires the Sun Java plugin, which many organizations will not allow to be installed on workstations due to security concerns."

That's rich. As if Javascript isn't a security concern.
Rowland
Thursday, February 23, 2006
 
 
AJAX has all the advantages of developing Web Apps, including scripting languages and their advantages, independence of operating system, powerful editors like Dreamweaver, Namo Web Editor, etc. :-)
Lostacular
Thursday, February 23, 2006
 
 
Let me guess, you're a Java programmer?

The barrier to entry to develop a Java applet is *quantum leaps* higher than it is to develop an Ajax widget.

I can vouch for this because I'm a forimdable Web developer, but I couldn't write a Java applet if my life depended on it. However, I started writing Ajax without so much as a second thought.  If you're already a Web developer, include a single Javascript file and -- voila -- you're writing Ajax.

Additionally, your backend stuff with Ajax (the API endpoints) run in the same context as the rest of your app (be it PHP, Ruby, whatever), so they have access to the same object model, etc.
Deane Send private email
Thursday, February 23, 2006
 
 
Well, for example, Google wouldn't be where they are today if everyone had to download a multi-MB runtime to make their site run. That's one of many reasons why you will never see Google using .NET.

Downloading runtimes is no big deal for us developer rocket scientist types, but it is a show-stopper for my Mom, and also (in general) for big companies that have extensive policies about screwing around with their computers, and often enforce it by locking down PC's to prevent anyone installing anything not authorized.
NetFreak Send private email
Thursday, February 23, 2006
 
 
The deployment negative has been mentioned. I'll mention development and end-user consistency.

Development. Learning a new GUI framework is non-trivial, a steep learning curve for every developer. To do Java applets the developer needs to know AWT (applets don't support Swing do they?). No one knows AWT. Not even Java developers (most of whom do server-side non-GUI work or at best, Swing/SWT on the client). AJAX requires a much smaller GUI framework learning curve because the underlying framework is HTML/CSS which is already a skill for developers. The main thing to learn is the JS event stuff.

End-user consistency. Java applets bring a whole new interface to the user, different widgets, different look. AJAX resues everything the user is already familiar with (while mollifying the one thing about HTML which users hate - page switching). All else being equal people would rather use the application/UI that's most familiar to them. Hence AJAX.
Spinoza Send private email
Thursday, February 23, 2006
 
 
Java no longer ships as part of IE (the government forced MS to remove it as part of the federal anti-trust suit). 

You might be able to use Java on the client inside your organization if your MIS dept installs Sun's JRE on all corporate desktops, but anyone developing apps for the masses abandoned (or should have abandoned) Java on the desktop a long time ago.

All this really shows is that MS is much smarter than the US govt.  Removing Java from IE didn't hurt MS at all, in fact, they were probably overjoyed that they *Could* remove it, as doing so allowed them to hammer the final nail in the java on the desktop coffin.  Prior to the Justice dept order, MS couldn't have removed Jave from IE without risking the threat of an anti-trust lawsuit from Sun.
System of a Don Send private email
Thursday, February 23, 2006
 
 
Microsoft didn't save nails in the Java coffin creation. :-)

Once upon a time, it even saddened me, because prior to .Net, Java was the promise to conquear programming once and for all, but after .Net, the choice wasn't as easy anymore. In the end, I chose none, so far.
Lostacular
Thursday, February 23, 2006
 
 
As far as I know Java applets have never been a success. Even when no alternatives were available. I think the main reason why people consider Java to be slow is because of their experience with Applets.

Offcourse Java Applets are better suited for the development of applications. And it probably will be even faster to develop, because it does not demand that much extra knowledge from a programmer. (Just Java instead of a non-trivial combination of HTML, CSS, Javascript, XML and a backend language)
However even today a Java applet just does not feel as good and responsive as an AJAX or Flash based alternative. Furthermore it is very hard to make a Java applet actually blend into your website.

About the back-button thing... I don't think a page with a Java applet will do any better. Good AJAX should not have back button problems anyway.
Michiel van Vlaardingen Send private email
Thursday, February 23, 2006
 
 
I cannot believe that anyone is seriously suggesting Java Appliets instead of AJAX.

The two are poles apart.

(almost) Total independence on both the back end, and the front end.

So much lighter on resources.

Easier learning curve for the developers

More intuitive for users progressively getting used to cool effects on the browser without having to download <<insert plugin>>

Hell, even today, you would be amazed at how many users do not have the flash plugin installed on their machines.

Generally, only the really paranoid will disable JavaScript on their browsers. That lot would be even more suspicious of java applets.

A great example of good usage of AJAX is the reddit site. I know they get a lot of flack, but I really like the way you can save an article, or mod it up, without worring about whether a page refresh will bring you to the same place.

Granted, there is a lot of bleeding edge stuff on the AJAX scene at the moment, and a lot of apps will be broken. On the whole though, AJAX is your friend.
Tapiwa Send private email
Thursday, February 23, 2006
 
 
Because Java Applets suck, always have and always will.
Sassy Send private email
Thursday, February 23, 2006
 
 
Apart everything said above, there is another reason: Javascript is miles ahead of Java as programming languages go.
Berislav Lopac Send private email
Thursday, February 23, 2006
 
 
Anyone remember Microsoft's remote scripting? It was a pretty slick predecessor to AJAX that used Javascript on the client calling an Java applet on another page.
Nick Hebb Send private email
Thursday, February 23, 2006
 
 
AJAX is buzzword compliant, and Java isn't anymore. 5 years from now we'll be reading posts about "why --newtechhere-- instead of AJAX applets?"
Peter
Thursday, February 23, 2006
 
 
Why not have both AJAX AND Java. How is the Java + Client-side scripting interops now days? Rock-solid? Uncrashable?
Li-fan Chen Send private email
Thursday, February 23, 2006
 
 
"Anyone remember Microsoft's remote scripting? It was a pretty slick predecessor to AJAX"

Actually, "ajax" is only a new and "cool" name for remote scripting. They are exactly the same.

"that used Javascript on the client calling an Java applet on another page."

WHAT? I don't think you're aware what you're talking about here...
Berislav Lopac Send private email
Thursday, February 23, 2006
 
 
> WHAT? I don't think you're aware what you're talking about here...

:-)

According to my kids, I _never_ know what I'm talking about. Oddly enough, this time I actually do:

(1) http://msdn.microsoft.com/library/default.asp?url=/library/en-us/rmscpt/Html/rmscpt1.asp

(2) http://en.wikipedia.org/wiki/AJAX (look at the History section)
Nick Hebb Send private email
Thursday, February 23, 2006
 
 
Web based messengers were not invented by google, Yahoo had its web based messenger for atleast 5 years. One of these messengers is based on Java applets and the other is based on AJAX. Well, need I say more ? Go figure which sucks and which rocks ?
It can't be... but I could be wrong Send private email
Friday, February 24, 2006
 
 
Sorry, Nick, but I was referring to what you wrote: "Javascript on the client calling an Java applet on another page"

Java applets run in a browser sandbox. Javascript is also executed on a browser. A browser is a HTTP client, and can only communicate with a server through HTTP commands (GET, POST, and rarely PUT, DELETE and others).

Your phrasing implies that a Javascript application communicates *directly* with an applet open in another browser window on another computer. As far as I know my HTTP, this is simply not possible, because you would have to know the latter computer's exact IP (which rules out anything behind firewalls) and it would also have to function as a HTTP server in some manner. The direct connection could be possible if both clients supported direct socket connection, which Javascript doesn't.

Both links you've posted are about using Javascript to communicate woth a server; it's certainly possible to have the server as a communication gateway between two opened "pages", but the direct connection is not possible.

So it's either an unlucky choice of words (especially the word "page"; a Web "page" exists only in a browser -- on the server it's just a collection of resources, some of them furthermore dynamically created on request), or there is something I am not aware of.
Berislav Lopac Send private email
Friday, February 24, 2006
 
 
Once applets didn't become universal they became a secondary tech choice. Just another plugin you probably don't have nor want to have.

The lazslo flash based approach is interesting. Flash is nearly universal and they leveraged that fact to do something different.
son of parnas
Friday, February 24, 2006
 
 
WTF is Laszlo all about? I looked at their web site for 10 seconds but decided it would be easier just to ask you.
NetFreak Send private email
Friday, February 24, 2006
 
 
OpenLaszlo is a platform for developing the user interface for web applications, using XML and JavaScript, and targeting the Flash player as the execution environment.
BenjiSmith Send private email
Friday, February 24, 2006
 
 
> "Actually, "ajax" is only a new and "cool" name for remote scripting. They are exactly the same."

I looked at the article the next poster references regarding remote scripting - http://msdn.microsoft.com/library/default.asp?url=/library/en-us/rmscpt/Html/rmscpt1.asp
which talks about applets, not XMLHttp[Request].

So how are they "exactly the same"?
Grant Wesley Parks Send private email
Monday, March 20, 2006
 
 

This topic is archived. No further replies will be accepted.

Other recent topics Other recent topics
 
Powered by FogBugz