July 2003 Archives

A Pair for the Bookmarks List

[ Annotated links are what web logs were originally supposed to be all about. ]

Joel Spolsky's 12 Steps to Better Code is really a checklist of software engineering basics.

Dave Thomas and Andy Hunt have an archive of articles they have published over the years. Many of them cover the same ground as their Pragmatic Programmer book — the broken windows metaphor is not my favourite — but there's other good material as well. Not too technology-specifiic but not too high-level either.

In both cases, they're just well-written. I'm reminded of the basic principle of coding: every function should do one thing only and do it well. The same principle applies for articles and other writing.

Modal Idiocy in Mozilla

Mozilla is a browser I use every day, but it's not without its UI quirks. Here's an annoying one

  • I open a link on a new window (using the right-mouse-button menu)
  • I use a different window while waiting for the new one to load
  • all of a sudden, the page times out and a modal dialog box pops up to tell me that it timed out and I have to click "OK" to make it go away

In Alan Cooper and Robert Reimann's About Face 2.0, this is described as " interrupting the proceedings with modal idiocy". It feels almost like being called by a telemarketer during dinner and it's just not necessary. A good UI would leave the "ltimed out" message in the window where it originated, where I could go find it when I'm ready.

It's helpful to have a name for a phenomenon. In this case, I hope the name contributes towards its eradication.

Spring: A New J2EE Framework

A few months ago I bought Rod Johnson's book, "J2EE Design and Development". It was full of good advice. I really like the way it uses principles from XP to balance orthodox J2EE advice. For example, this book was one of the first places I saw someone write that entity EJBs may not always be worth the effort.

However, it went into great detail on an example web application, without using any of the existing frameworks. It seemed perverse in a book that proclaimed its pragmatism to develop a new framework from first principles when it had been done before. My concentration lapsed several times while I waded through the source listings, wondering why I should care.

You could download the source code from the Wrox web site, but it was incomplete and not all that well packaged. It was also far from clear under what terms it could be used. Would I be liable for copyright infringement if I tried to use the code? If I found a bug what would I do? It all seemed hopeless at the time.

Now, the Spring Framework is available under an Apache license. At first glance, it is the same code as before, but with better packaging. A quick browse through the new examples shows that there has been a fair bit of development during the time since the book was published. There's also a new core developer, Juergen Hoeller. The announcement on TheServerSide also summarizes some of the improvements.

(It's too bad that the discussion thread on the announcement degenerated quickly into a checked versus unchecked exception flamewar. )

In retrospect, the book is in large part an extended design document, with background and annotiations. A good portion of the book is the rationale: why would anyone want to develop yet another framework. It planted a hunger in me for something better than Struts (the only Java framework I had used until that point).

Spring does not tie your business logic to the Servlet interface or force you to declare SQLException all over the place. If it's not exciting to read, that's because it takes care of the dull details.

Certainly, things will change, considering this product has not reached version 1.0 yet. There are other frameworks: WebWork seems to be a popular one. However, Spring looks well thought out and I would like to try it out on a project.

[ I have edited this piece since originally posting it and may do so again as I learn more.]