This review of the Apache Wicket Cookbook is interesting because, as it turned out, I was asked to write this book originally! I had been singled out based on my contributions to the 5 days of Wicket. The offer was made back in 2009 when I was placed at a contract full-time on-site at a client. I knew there was no way I could crank out a book in the timeframe given while dealing with work deadlines, not to mention having time left over for my family.
The [PACT] representative assured me it would be ok, but made the suggestion I should look for a co-author to help. That actually sounded like a good idea, so I approached a person I was working with and put them in touch with the representative. Turns out this person whom I handed a co-author spot to couldn’t even be bothered to respond to [PACKT]! So in the end, being realistic about the time-frames and my current workload, I passed on the offer and suggested they try and get one of the committers (other than the two who wrote Wicket in Action) to write it. I honestly have no regrets about this decision, I think I would have ended up writing the entire thing *myself* between 9pm-2am. That would have gotten really-old really-fast. If my co-author couldn’t even make the time to respond to an email, how would they every help me write a book?
Fast forward to present day...
I happened to catch via my twitter feed that Igor Vaynberg wrote a book on Wicket! This is a very good indication that I have not been paying attention to the ##wicket Freenode channel lately! I was delighted to know it was Igor who landed the book offer. He is literally the foundation of the wicket-user mailing list. He has single handedly helped more people with more problems (which are usually more PEBKAC than anything) than anyone else. Not to mention he’s a heavy committer to the project itself.
The book is in the [PACT] Cookbook format, and that is to say, a cookbook meant for an experienced chef, not the “20 minute recipes” variety. So don’t go into this book without a firm understanding of Apache Wicket. My suggestions would be to go out and get yourself a copy of Wicket in Action first, then pickup this book when you want to learn some pragmatic solutions to the “how do I do X in Wicket” questions you might have.
The format of each section of the book takes on this style:
- State a problem (i.e. “How do I display data as charts?”)
- Show an Example
- Explain each aspect of the example
- Give supplementary hints and tips
I liked how each segment of the example was broken out and explained. My only criticism of this approach would be, in the interest of saving trees, the code samples could have been annotated and then each explanation tagged with the annotation of the code sample it references.
Again, you must have a good foundation in Wicket to understand what’s going on in much of the book. Even I was thrown for a loop when Igor used the following in his examples:
Form<?> myForm = new Form<Void>(“myForm”)
I couldn’t for the life of me figure out what the “Void” was doing. Was it part of Wicket? Was it part of the JDK? I couldn’t even really formulate the proper Google search to find out. Finally I resorted to asking the question on Stack Overflow and got an acceptable answer. My point being is, it wasn’t explained in the book, it was assumed the reader knows. I think perhaps the reviewers should have caught stuff like that. Either that or I'm just an idiot for not knowing how that all worked, which is probably the more reasonable explanation.
The chapters of this book are indicative of its author. These chapters are based off of questions I’m sure are asked many times on the wicket-user list and that’s what makes the book so great. I mean, how many times have I seen the question “How do I prevent my form from submitting more than once?”. There’s a chapter for that. Or: “How do I authenticate users of my site?”. There’s a chapter for that too!
Great book, go buy a copy!
Given Igor’s legacy, I’m sure writing this book was 100% less work than if I would have done it (not to mention 100% better!). The recipes were already written by him countless times in the community on both the user-list and the Wicket codebase itself. He merely had to collect his thoughts and consolidate it all in one place. Great job Igor!
I look forward to future cookbooks by Igor, this old dog definitely learned some new tricks along the way.