Designing, coding and debugging Java Rich Client and Java EE Applications

Monday 21 April 2008

Desktop versus Web

During the last ten years we saw an impressive rise of the web and web applications. And I have to admit: I really couldn't live without Google, online restaurant critics and hotel bookings any more. On the other hand this also meant the decline of Java desktop applications.
And when I talk about desktop applications here, then it's not meant in the MS Word or Photoshop sense, but rather in the sense of of rich client to some sort of enterprise backend.
While working as a consultant I had to realize, that most of the time the decision to build a new application based on web technology has already been made in advance. This makes a lot of sense in case of, for instance, an online banking application, because that way you can start sinking money into the stock market without having to download anything. It's fast it's, convenient and you can start loosing money right away, no mater where you are. However, if we talk about an application for editing master data that is used by a handful of people on the companies intranet, does it still make sense?
Well, if you asked that question to the person that made the decision in favor for the web application then the answer usually will revolve around the huge problems that supposedly arise from supporting a desktop application on a handful of PCs. While incompatibility issues have been completely unknown to HTML+Javascript clients (as long IE 5.5 on Windows 2000 is used), ensuring the presence of a certain Java version on all 7 desktop computers what were supposed to run a Java desktop application is often regarded as impossible.
Maybe everybody was so excited about web technology that they forgot entirely about Java Webstart that could take care of deployment issues and the richer experience and increased productivity that a desktop application could deliver. Unfortunately this sure was true of Sun. While they did great things with the J2EE platform during the last couple of years, little changes where made to Swing right until Java 6!
So, what is the state of desktop applications right now?
With the newly released Netbeans 6 ans 6.1 which incorporates early versions of the beans binding and swing application frameworks and an excellent GUI builder, it finally seems possible to develop Swing applications in a fast and convenient way. Java 6 update 10 will
feature alongside other things a very nice and clean new look and feel (called Nimbus) and improved performance for GUI rendering. Is this enough for the rebirth of desktop applications?
Well, I think most of the improvements made where really overdue. And if we talk a look at the state of web application now, we find that these are going stronger than ever with the arrival of AJAX and so on. The new type of web applications that uses Flash, GWT or other AJAX frameworks posses desktop like features like drag&drop, are graphically rich and responsive. All trades, that once set desktop applications apart (if they were done right). And with (Google) Gears web application running within the browser even gain offline capabilities. Then there is Adobe AIR: It allows for applications that look just like desktop apps, are programmed in Flex to run in the browser or (dramatic pause) on the desktop.
Does this mean the end of desktop apps then? Hmm, maybe the death of desktop applications AS WE KNOW THEM. But if you take an application written in Flex and an application written in Swing or JavaFX, then both may run inside your browser or outside of your browser in their own runtime. The code will be the same in either case, safe for some restrictions imposed by the browser sand boxing.
So if you ask me: If it looks like a desktop application, feels like a desktop application and is programmed like a desktop application the it IS a desktop application.
Even if it's embedded in a web page, the programming model will be very desktop like.
This means for future Java applications there will be two main options: A simple HTML fronted, maybe enhanced with some AJAX, for mass market applications like a reservation engines or restaurant listings and a web/desktop hybrid approach powered by either Flash/Flex or Swing/JavaFX for more versatile applications.