How do I decide between a using a Swing GUI or a light-weight web client for the user front end of my Java application?
ajax, java, swing, user-interface
Solution
It depends on the application and this is essentially a usability driven question (though there are considerations like data storage and platform requirements). Think of the pros and cons.
Pros of a lightweight Web UI:
- Ease of distribution
- Platform independent
- Ease of maintenance
Cons of a lightweight Web UI:
- Less environmental control
- Markup standards vary between browsers
- Requires a web server and everything that goes with it
Pros of an executable UI
- More environmental control (i.e.: full screen applications, etc)
- Not necessarily subject to latency and outages
Cons of an executable UI
- Pushing updates may be more difficult
- Requires installation
- Potential platform requirements (frameworks, packages, etc)
- Potentially requires knowledge of advanced networking topics (web services, etc)
Problem
I always seem to have this internal struggle when it comes to user interface. I build up an application "engine" and tend to defer user interface to after I get my algorithms working. Then I go back and forth trying to decide how to let a user interact with my program. Personally, I'm a fan of the command line, but I can't expect that of my users generally. I really like what's possible in the browser in the age of web 2.0 and ajax. On the other hand it's not so hard to make a Swing front-end either, and you can generally count on a more consistent presentation to the user (though using a good javascript framework like YUI or jQuery goes a long way toward normalizing browsers). Clearly both approaches have their merits and drawbacks. So, what criteria / parameters / situations should lead me to use a lightweight (e.g. web-based) GUI? What criteria / parameters / situations should lead me to use a heavier (e.g. Swing-based) GUI? It is not my intent to start a flame war, merely interested in the community's constructive/objective opinions. Edit #1 In light of the first few responses, I would like to clarify that I would like to deploy my application regardless, not host it on some internet server necessarily. So I would have to deploy with a light-weight web-server infrastructure a la Jetty/Tomcat or similar.