Wicket in Action

A comprehensive guide for Java developers building Wicket-based web applications

Removing Fragile String Expressions From Wicket Code

November 25th, 2009 by ivaynberg

The most used model in Wicket is the PropertyModel and its derivatives. This model allows the user to quickly and easily navigate object graphs using string-based property-path expressions, and is used extensively when displaying data or creating forms.

However, the PropertyModel and its string-based expressions are also responsible for adding the most fragility to Wicket code. The standard Java tooling does not support refactoring strings that happen to contain references to java constructs such as methods or fields; thus errors in these string expressions are not discovered until runtime.

For example, the string used in the code below:

new Label("state",
        new PropertyModel(personModel, "address.state.code"));

will not be updated by the tooling when the getState() method is renamed into getArea() and will thus cause an error only discoverable at runtime.

So why is PropertyModel used so often in Wicket code even though it causes so many problems? The answer is simple: it is, by far, the easiest and most convenient way to achieve the functionality. We chose to sacrifice robustness of our code for development ease and convenience. What if there was another way to achieve the same, but without using strings?
Read the rest of this entry »

London Wicket Event November 21st

November 4th, 2009 by dashorst

Something special is brewing in downtown London on Saturday, 21st November. jWeekend is organizing a very special event at the iconic Foyles Bookshop in central London.

Join core committers Matej, Alastair, Jeremy and Martijn together with WiQuery gurus Richard and Lionel for an afternoon of intellectual Wicketness.

Join us for some very interesting, high quality presentations and to chat with fellow Wicket users and developers at all levels. We’re expecting this to be another popular event and since places are limited book and confirm early if you can make it. Details and registration are at the usual place.

There is a cool little Jazz cafe at Foyles too, where there’ll be a live act (Femi Temowo) at 13:00 if you enjoy some Jazz guitar relaxation before your intellectual stimulation. They offer a decent range of food and drink there too.

I’ll be available to sign some books, so Bring Your Copy of Wicket in Action—or buy one in the store and have it signed!

With this book, Wicket will become the greatest territory the Dutch have settled since Manhattan.

Nathan Hamblen
Senior Software Engineer, Teachscape Inc.

This is the complete and authoritative guide to Wicket, written and reviewed by the core members of the Apache Wicket team. If there's anything you want to know about Wicket, you are sure to find it in this book.

Jonathan Locke
Founder and Architect of Apache Wicket, Foreword Wicket in Action

Without question, Wicket in Action... is the be-all and end-all when it comes to Wicket.

Geertjan Wielenga, Wicket Netbeans Plugin Author

The tutorial and conversational tone of the writing makes the book very approachable.

Nick Heudecker
System Mobile

Loved the sample application—it tied everything together.

Phil Hanna
Senior Software Developer, SAS Institute

The essential guide for learning and using Wicket.

Erik van Oosten
Lead programmer and Project Manager, JTeam

Finally, the Web Framework of web frameworks, Apache Wicket, now has a bible of its own.

Per Ejeklint
Senior Software Architect, Heimore group

Wicket is an innovative evolution of the MVC programming with simple roots, but without a primer such as this, it can be more challenging than it needs to be.

Brian Topping
Founder, Bill2 Inc.

Wicket In Action glues the areas of web development with Apache Wicket together and gives a great overview of Apache Wicket...it will make a great compendium.

Nino Martinez Wael
Java Specialist, Jayway Denmark