Jun 5 2007

Being Productive with Swing

Ben Galbraith, founding blogger at Ajaxian, gave an insightful presentation at JavaOne 2007 on Swing. Ben started off by saying that Swing isn’t in the ‘Wow’ game like WPF, Cocoa, or Flex/Apollo. According to him, JavaFX Script might fill that gap but not just yet. In software development, productivity is king. Productivity is the currency of IT development. According to Ben, the Swing Application Framework does not address productivity but instead focuses on basic architectural concerns.

A theme that I picked up from Ben was that there is too much freedom when working with Swing and everybody builds GUIs in their own fashion. Since there is no consistency in UI development even within a project and since there is no solidified framework, Swing applications are hard to maintain and support.

Basically, there is no opinionated software in Swing to provide a standard, convention over configuration, pattern for building Swing-based applications. The key concerns a Swing framework needs to address are data binding, actions, listeners, activation, consistent form, and life cycle events amongst others.

One invaluable recommendation made by Ben is to use the JGoodies Forms layout if you hand code your UIs. Otherwise stick with your favorite UI Builder. He recommended the UI builder over fidgeting with UI code by hand. He said that coding a UI by hand is like hand writing a 50 page TPS report. He also reminded the audience to not muck or edit generated UI code. Ben said to let the UI builder own the code.

Ben recommended JForm Designer as an excellent commercial GUI builder and NetBeans as an Open Source alternative. Without a UI builder, it is difficult to attain UI consistency while fudging with spacers, fonts, insets, etc. Having a framework helps to attain a consistent layout for you desktop application.

Ben also had time to mention his framework, Swing Clarity. Clarity is a Swing Rich Client Platform that borrows heavily from Ben’s experience as a Ajax/web developer. Clarity has a Prototype-like method, $(), which can find named UI components using CSS-like selectors. With Clarity you can bind behavior to components by the variable name of the component with the help of custom @FormUIField annotation. I will definitely look into this framework as it introduces some ideas that make web development exciting. Clarity also provides bi-directional data binding and allows for some amount of skinning.

As an interesting side note, Ben called Karten Lentzsch, JGoodies project lead, the God father of Swing experts.

Technorati Tags: , , , , , , , ,


Jun 5 2007

JavaOne 2007: Thursday General Session

Padmasree Warrior, Motorola Executive Vice President and Chief Technology Officer, gave the Thursday general session at JavaOne. As you can imagine, her theme was the mobile network. In a presentation entitled Platform Disturbia she stated that in the mobile device world each network, each device, each spacial domain is its own platform. She also presented some figures where she states the there are more cell phone devices than cars, or televisions, or any other electronic consumer good. Padmasree enthusiastically said, “The whole world is a hot spot.”

Padmasree had a quick panel discussion regarding which mobile technology will win, mobile AJAX vs J2ME. The panel discussion was with mobile tech writers and pundits AJit Jaokar and C. Enrique Ortiz. In the end, I think it was Enrique that said that both have their strengths and weaknesses. To me, the debate sounded a lot like the same one between the desktop and web applications.

One thing that Padmasree said that stuck with me was that software development is about the user experience not the user interface. Sometimes as engineers we do over think a solution. We often design a system which ends up looking and behaving like it was designed by a software engineer, not a real person.

Motorola also took the time to promote their Open Source initiatives and their Developer Studio.

Technorati Tags: , , , , ,


Jun 3 2007

Putting a Swing Front End on a Web Application

During this JavaOne 2007 BOF, David Wroton shared his experienced of porting a JavaServer Faces (JSF) front-end to a Swing desktop client. David started with the whole browser vs fat client debate. David listed his issues with the browser, such as HTML Scrolling, back button, Funky JSF URLs. He said that “the back button is something that is breaking society.” The benefit of developing a HTML web application is that it is easier to get started.

The issues listed by David as holding back a rich Swing desktop include installation, maintenance, and getting started from scratch. To work around installation issues David used Java Web Start and instead of writing the desktop client from scratch he looked into using a Rich Client Platform such as Eclipe, NetBeans or Spring. Regarding the choice for which RCP to use he said, “There was a review last year, the review said, man, they are all hard.” Ultimately he selected Spring RCP, mostly because of his previous exposure to Spring. According to the speaker, Spring RCP has good form, data binding, and validation support. The major draw back to Spring RCP is the lack of documentation, an issue descried in last years’ review of Rich Client Platforms.

In closing, the David told the audience that the desktop is far more rich than any web based application, but AJAX goes a long way making a web application more user friendly and for many applications that is enough. Finally, he said there are still no clear lightweight/agile solution for a Swing framework.

Technorati Tags: , , , , ,