Skip to main content

Swing - again

Posted by daniel on November 11, 2003 at 1:01 PM PST

"I believe in Swing. I really think it's the best toolkit for writing robust cross-platform applications. However, if we don't do something to jumpstart it's growth then it'll die along with the dinosaurs: big, powerful, and unable to keep up."

That's how Joshua Marinacci begins his entry Swing has failed. What can we do? in the Weblogs section. The article may begin as if it is a troll but Joshua makes many important points and helps to focus the discussion. He writes

Swing apps are slow to build. Building a Swing GUI takes time because you have to do it programmatically. No GUI builder can do it reliably. While the extra day you spend writing layout code may not be much in the life of a six month project, it still matters. The GUI needs to go through many iterations, preferably as early in the project as possible. If it takes hours to make changes then the project probably will not slip behind due to the extra development time. Instead the extra iterations just won't be made, resulting in an inferior product.

He continues and complains about the state of Swing layout managers, about the difficulty of maintaining Swing applications, about the lack of native features and that Swing is too powerful and too complicated. Gosling describes it as being like the cockpit of a 747.

Joshua then issues challenges to Sun and challenges to the community. The article has captured a lively discussion in the feedback. Joshua clarifies a misunderstand point, pointing out that he is not suggesting "that we should remove any of the power of Swing by dumbing it down. On the contrary, I think we should have a simpler API build *on top of Swing* that handles all of the easy day-to-day tasks. It needn't even be an API (ie. a set of classes and functions) but perhaps an XML screen description file. Either way the true power of Swing will always be there when we need it."

Michael Nascimento Santos asks How do you teach Java? He has been wrestling with teaching Java to programmers with no experience and to experienced C++ programmers. Some of the problems he has had with experienced C programmers is that they have difficulties "producing accurate, well designed classes since they tend to write code before really understanding the problem they are trying to solve. They are used to write code, delete it as they notice it doesn't solve the problem and then rewriting it again and again till it works. When it happens, well, a considerable part of the code is just rubbish."

We also forget that they can not "think in Java" because they don't yet understand the language. But the biggest problem is that "people find it much harder to understand object-oriented concepts than the whole language itself."

Maxym Mykhalchuk's first entry is on Corporate OpenSource. He explores why a company would open source given that "Business is a selfish thing, and everybody wants to get a benefit. That's normal, and that's one of the reasons behind OpenSource model. Its beleived benefits are wider publicity, larger userbase and better code quality. Usually a big corporation has a small subset of its tool as an OpenSource application, while building a commercially sold and supported toolset on top."

In Also in Java Today , we link to the "Java Technical Insight of the Month" from Object Computing. This month, Mario Aquino presents A Simple Data Access Layer using Hibernate. He writes about the problem with the traditional approach where

applications resorted to calling JDBC APIs and passing SQL strings to Statement objects to execute data lookup queries. The lookup calls returned ResultSets that an application would use by calling accessor methods matching the data types of the returned columns. While effective, this approach is fragile because it relies on Strings in application code matching the names of database tables and columns; changing the names of database tables or columns required finding all of their references in the code and changing them. This is problematic if not inelegant.

A better way to interact with a datastore is to eliminate explicit hand-written references to datastore entities while also providing a simple and intuitive API to retrieve and update data that is backed by a database. Preferably, the alternative should not rely on JDBC Statements, SQL strings, or ResultSets. Instead, a solution could create a natural mapping between Java objects and database entities, one that would require a minimum of hand coding to maintain that mapping without removing any of the data retrieval and control facilities provided in the JDBC APIs.

The Oracle Technology network presents an article on what's coming in J2EE 1.4 in Servlets and JSPs step up. Budi Kurniawan highlights the new features in Servlet 2.4 and in JSP 2.0.

In Projects and Communities the Javapedia project is looking for contributions to the page on Content Management Systems . You will find a growing list of open source CMS and one commercial version along with a request for a more comprehensive introduction to the topic. The Java Tools community points to one possible response to Joshua Marinacci's blog with a link to the UICompiler for Java. This tool helps "you implement your GUI handling code; which is not much more then implementing a method named like the button you placed in Qt Designer."

In today's News Headlines :

Registered users can submit news items for the href=""> News Page using our
news submission form.
All submissions go through an editorial review by news director Steve
Mallet before being posted to the site. You can also subscribe to the href=""> News RSS

Current and upcoming Java Events:

Registered users can submit event listings for the href=""> Events Page using our href=""> events submission form.
All submissions go through an editorial review before being posted to the

This blog is delivered weekdays as the href="">Java Today RSS
feed. Once this page is no longer featured as the front page of href=""> Java Today it will be archived at href=""> You can
access other past issues in the href=""> Archive.