» Book review: Wicket in Action

Book review: Wicket in Action


Posted on 28 September 2008 - 20:10

More than 2 years ago, I was searching for a web application framework to build some of the Joost backoffice systems. I was looking for something simple yet powerful, if that thing existed, and did not require a massive amount of learning nor lots of XML configuration files to be able to develop something useful. I stumbled upon a series of articles on JavaLobby about something called Wicket, and it was jaw-dropping: a simple Swing-like Java library, plain HTML with a few added attributes was all what was needed to build useful web applications.

Two years later, Wicket has found a new home at Apache (I'm happy if I helped by mentoring the transition), has a vibrant community and a great team of talented developers, and Martijn and Eelco, two of the main developers, have written Wicket in Action, a book you definitely should read if you want to quickly cover most of what you can do with Wicket.

The book is written in a humorous and entertaining style which makes reading its 350 pages a real pleasure, without sacrificing the needed technical strictness. It's also full of hints and advices that show the deep real-world experience accumulated by the authors, which is also present in many aspects of the framework itself.

The first section of book goes through the classical "Hello world" to explain the basics and the main principles underlying Wicket's architecture. The rest of the book then uses the "Cheesr" online cheese shop for the examples, with hilarious comparisons between software architecture and lasagna layers :-)

The next chapters cover the essentials of Wicket: models (an essential aspect of Wicket), the extensive component collection, tables, form processing and validation, reusable web components and templates and page composition. Wicket provides a lot out of the box, but the authors often explain how to extend the framework to handle specific needs.

Then comes internationalization, resource management (where do you place the images and CSS that go with your reusable Java components?), producing something different than HTML, with a nice CAPTCHA component. The chapter about Ajax shows how the component-oriented architecture of Wicket makes it very easy to perform partial page rendering to react to user actions.

And since Wicket is "just" a web application framework, a chapter covers integration with Spring and Hibernate, although you can use anything you want for your application and data layers.

Some critics about the book? A bit surprising is that installing Wicket is covered a "bonus chapter" available online. Sure, it is mostly about Ant and Maven, but adding a few pages about how to setup Wicket in your web.xml in the book would have been good. Also, the last chapters about unit tests and production deployment are a bit short. I would also have loved details about the many options Wicket provides for session management on which it relies a lot, and which is an important concern on a busy website.

But overall this is an excellent book. This is a labor of love as Martijn and Eelco have spent a huge amount of time and energy on it (I've been reading some early chapters more than 18 months ago) and it shows in the final result. If you're using or are considering using Wicket, it's very much worth it.
Anonymous's picture

Hi!
I'm a developer at javabooks.org. We went online yesterday, so we need some help with the reviews. We would be happy to have your review on our web site.

Thanks,
Mircea