TechBookReport logo

Keywords: Java, J2EE, agile development, open source

Title: Better, Faster, Lighter Java

Author: Bruce Tate and Justin Gehtland

Publisher: O'Reilly

ISBN: 0596006764

Media: Book

Level: Intermediate and advanced

Verdict: Interesting, thought-provoking

The biggest problems facing Java development, according to Bruce Tate and Justin Gehtland, are bloat and increasing complexity. These related problems are best exemplified in the complex, top-heavy frameworks of J2EE, particularly those frameworks pushed by the larger vendors. The alternative, 'better, faster, lighter Java', is what the authors propose as an escape from this creeping complexity that is making big Java developments increasingly costly and problematic.

The key to solving the problem is to focus on some of the key virtues that differentiates successful solutions from ugly kludges with high-maintenance costs and snails pace development rates. These key virtues include a high degree of decoupling, simple code that is well-focused and easily understood, simple frameworks that help rather than hinder.

And how do we achieve these laudable aims? It's not by using heavy-weight processes or by getting into the depths of container managed persistence using EJB. Instead the authors propose five key principles:

Guided by these five principles the book first looks in more detail what each of them means in practice. There is a common thread that binds these principles together, and that is a striving for simplicity and elegance. While the authors do not explicitly talk about the need for elegance it is there nevertheless, and in software no less than engineering, science or maths the simplest solutions are often the most elegant as well.

With the five principles in place the authors then move on to look at some very specific examples in action. The open-source Hibernate persistence model gets a chapter to itself, starting with a contrast between it and EJB CMP. The issues around persistence are explained and then a worked example of using Hibernate is shown. The chapter ends by returning to the five principles and examining the ways in which Hibernate meets (or fails to meet) each of them.

This is followed by a chapter on the Spring open-source framework for putting together J2EE applications. Again there is a quick intro and then into a worked example. In this case the example is the jPetstore application which was itself put together to contrast with Sun's J2EE reference Petstore example. Again once the example is out of the way the five principles are again used as a measure of how well Spring succeeds in being a better, lighter, faster Java solution.

The next couple of chapters (9 and 10) look at how the principles and the simpler toolsets identified previously can be used to tackle a problem. The core of this is a web spider application. Chapter 9 first develops the Spider, going from requirements through to working code. There is an emphasis on process here, which, as might be expected follows a largely agile agenda. The point is also made that open-source solutions should be high on the list of tools and libraries to consider. The evolutionary process of open source is cited as one good reason for this - if the software is no good then it will wither and die, it's as simple as that.

Chapter 10 shows how the Spider application can be slotted into the jPetstore application. It's a good example of how following the five principles can pay dividends in terms of extensibility, adding functionality and maximising code reuse.

The final chapter is a call to arms. The challenge of fighting the bloat is once again outlined. This final chapter does more than recap what the rest of the book has been saying. It also makes a decided nod towards aspect oriented programming (AOP).

This is an interesting book, with a controversial message that needs an airing. There's an agenda here as well, an argument that Java needs rescuing from the (market) forces that are adding bloat and complexity. The strong emphasis on using open source tools (JUnit, Ant, Hibernate, Spring etc), leads naturally to the suggestion that Java itself should be open-sourced.

This is an interesting and timely book, with a core message that should be of interest to all manner of Java professionals.

Hit the 'back' key in your browser to return to subject index page

Return to home page

Contents © TechBookReport 2004. Published 19 July 2004