File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Architect Certification (SCEA/OCMJEA) and the fly likes Swing client Vs Applet Vs RIA (AJAX, etc) Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Certification » Architect Certification (SCEA/OCMJEA)
Bookmark "Swing client Vs Applet Vs RIA (AJAX, etc)" Watch "Swing client Vs Applet Vs RIA (AJAX, etc)" New topic

Swing client Vs Applet Vs RIA (AJAX, etc)

Cory Chen

Joined: Sep 08, 2008
Posts: 19
I need to compare this for an internet application (not intra-net), which does not need to do anything that is restricted by the browsers security sand-box.

I won't use then in real world because of their buggy nature, slow load time, etc. However I can't put that as a reason in part 2.

If used with RMI, then requires HTTP tunneling, else you need to keep the RMI port open
Expects the client system to have minimum software and hardware
Difficult to maintain as a changes need to be pushed to all client systems (I know WebStart has improved this a lot)
Rich interface
Minimizes data transfer over network
Can work with limited ability in a disconnected mode

RIA (AJAX, etc)
Has all the pros of Swing client, plus it can use the Web 2.0 features
Lots of JavaScript (can be eliminated by an API by JQuery)
Multiple technologies to learn
If not done carefully, might result in a lot of network traffic

Having said that all, I am inclined towards using a RIA for my part 2 assignment. Please let me know if my analysis has covered every possible pros/cons and what would be the best way to describe this to Sun.

Thanks for your comments!
Suresh patel
Ranch Hand

Joined: Sep 13, 2007
Posts: 32
What are you planning to use for creating RIA Client ?

Is it JavaFX ?
mc khan

Joined: Aug 14, 2008
Posts: 19
JSF + AJAX. Similar to the latest PetStore app.
Suresh patel
Ranch Hand

Joined: Sep 13, 2007
Posts: 32
I don't know which assignment you are having in part-II but from your post I can predict you are talking about web application framework.
i.e thin client and for that JSF + AJAX is good choice.
Cameron Wallace McKenzie
author and cow tipper
Saloon Keeper

Joined: Aug 26, 2006
Posts: 4968

"I won't use then in real world because of their buggy nature, slow load time, etc. However I can't put that as a reason in part 2."

That's probably not something you'll want to say too loud on a Sun exam.

"Difficult to maintain as a changes need to be pushed to all client systems (I know WebStart has improved this a lot)"

That's probably not something you should mention either.

You shouldn't approach a Sun exam thinking that two of the three core presentation technologies they offer won't work because they are buggy and difficult to maintain. You're one step away from submitting a Visual C++ program to them and saying "see, Microsoft does it right, so that's how I did it!"

JSF and AJAX are good, but I don't think when Sun talks about rich clients, they are talking about Web 2.0. When Sun talks about a rich client, they usually mean Swing, the richest of them all.

Remember, this is a Sun exam. If you start throwing in all sorts of peripheral technologies, or non-Sun technologies, you may find yourself in trouble. I love JQuery, but I'm not sure if the SCEA exam is the right place to be promoting your affection for the technology.

-Cameron McKenzie
Cory Chen

Joined: Sep 08, 2008
Posts: 19
Thanks Cameron!

Sun does cosider AJAX as an alternative to an Applet. Below is an extract from Sun. My users won't be running in an intranet.

What about applets and plugins?
Don't be too quick to dump your plugin or applet based portions of your application. While AJAX and DHTML can do drag and drop and other advanced user interfaces there still limitations especially when it comes to browser support. Plugins and applets have been around for a while and have been able to make AJAX like requests for years. Applets provide a great set of UI components and APIs that provide developers literally anything.

Many people disregard applets or plugins because there is a startup time to initialize the plugin and there is no guarantee that the needed version of a plugin of JVM is installed. Plugins and applets may not be as capable of manipulating the page DOM. If you are in a uniform environment or can depend on a specific JVM or plugin version being available (such as in a corporate environment) a plugin or applet solution is great.

One thing to consider is a mix of AJAX and applets or plugins. Flickr uses a combination of AJAX interactions/DHTML for labeling pictures and user interaction and a plugin for manipulating photos and photo sets to provide a great user experience. If you design your server-side components well they can talk to both types of clients.

All the assignment says is to "PROVIDE STRONG VISUAL FEEDBACK TO USERS". I thought AJAX is best suitable for that. I'll re-evaluate.

Cory Chen

Joined: Sep 08, 2008
Posts: 19
When should I use an Java applet instead of AJAX?
Applets provide a rich experience on the client side and there are many things they can do that an AJAX application cannot do, such as custom data streaming, graphic manipulation, threading, and advanced GUIs. While DHTML with the use of AJAX has been able to push the boundaries on what you can do on the client, there are some things that it just cannot do. The reason AJAX is so popular is that it only requires functionality built into the browser (namely DHTML and AJAX capabilities). The user does not need to download and/or configure plugins. It is easy to incrementally update functionality and know that that functionality will readily available, and there are not any complicated deployment issues. That said, AJAX-based functionality does need to take browser differences into consideration. This is why we recommend using a JavaScript library such as Dojo which abstracts browser differences. So the "bottom line" is: If you are creating advanced UIs where you need more advanced features on the client where you want UI accuracy down to the pixel, to do complex computations on the client, use specialized networking techniques, and where you know that the applet plugin is available for your target audience, applets are the way to go. AJAX/DHTML works well for applications where you know the users are using the latest generation of browsers, where DHTML/AJAX "good enough" for you, and where your developers have JavaScript/DHTML/AJAX skills. Many amazing things can be done with AJAX/DHTML but there are limitations. AJAX and applets can be used together in the same UIs with AJAX providing the basic structure and applets providing more advanced functionality. The Java can communicate to JavaScript using the Live-Connect APIs. The question should not be should framed as do I use AJAX or applets, but rather which technology makes the best sense for what you are doing. AJAX and applets do not have to be mutually exclusive.
I agree. Here's the link:
subject: Swing client Vs Applet Vs RIA (AJAX, etc)
It's not a secret anymore!