I’ve gotta crow a little more about Wicket, a superb, relatively lightweight web-tier framework. I’ve been using Wicket 1.1.1 for about a few weeks now, and I really like it. I am planning to upgrade to 1.2 as soon as the full release is available (at the time of this writing, they are at 1.2 RC3). Lots of good changes, I hear. I can’t wait.
Anyways, to make this a balanced article, I do have to point out a few things I don’t like about Wicket. First, the out of the box support for some of the most common controls is okay. Passable. Decent. But not great. To get components that really do stuff the way you want ’em, you have to subclass the appropriate Wicket control (DropDownChoice is one I find myself subclassing ALL the time). Now, that would be fine if what I wanted to do was something, you know, kinda off the wall. But, I don’t think asking a DropDown list box what its current selection is, is something I should have to write a subclass to do. Right? Second, there’s probably a way to get the out of the box Wicket controls to do what you want (this seems to run counter to my first point, but read on), but the documentation is so abysmal that you pretty much have to read the code to figure out if the component will do what you want. Third, the Wicket framework is incredibly easy to use. “Aha!,” you say, “That’s not something to not like!” But that ease of use comes at the price of INCREDIBLE complexity of the code. So what? Well, as I mentioned, the doc is so terrible, that you have to read the code to figure out what the component is doing.
Brief Wicket tour of the code. Anytime I want to dive into the code, it starts with the component I’m looking at. Say, DropDownChoice. No, wait, it’s really an AbstractSingleSelectChoice, which is really an AbstractChoice, which is a FormComponent, which is a WebMarkupContainer, which is a MarkupContainer, which is a Component, which (pant, huff, puff) is a java.lang.Object. Wow, that’s some deep inheritance graph. Now, having used Wicket for a while, I completely understand the design here (and it’s a good one, btw). But, it’s terribly complicated. And if the doc wasn’t so terrible (did I mention that already?), I wouldn’t have to worry about it.
All in all, I vote Wicket an A-. I’m using it until something better comes along (good luck!). I’ve tossed Struts out the rear window and I’m not looking back. I’ve traded a second class object model and a hundred XML files for straight HTML and a first class Java object model.
BTW – if anyone knows how to get the out-of-the-box DropDownChoice to give up its current selection (without subclassing, overriding wantOnSelectionChangedNotification() and onSelectionChanged()), I’d really like to know. I never did figure that one out.