Lately I’ve been playing around with Wicket for work. It’s a very interesting framework that, from my experience at least, you will either love immediately or scratch your head for a time as you unlearn Struts or another framework.
We don’t need no stink’n JSPs!
It seems that with Wicket the days of having to write Java in JSPs are gone, in fact Wicket doesn’t use JSPs, it uses good ol’ fashion HTML files. This is very nice and allows you to really separate the design of a page from the functionality. The only downside with how Wicket uses the HTML markup is if you change the structure of the markup, which you will do when developing, you’ll have to reorder your components in code and recompile. If you make use of Wicket’s markup, which you will, the number of times you have to recompile goes down drastically.
It’s all about the Ajax
Wicket’s out of the box Ajax features are very impressive! Browser safe, feature rich, and simple to use. This has already saved me a lot of time writing my own JavaScript libraries. I really like how the designers took into consideration that not everyone has an updated browser and have “safe” Ajax classes. If ajax is supported, use it, otherwise use POST/GET.
The only down side with using Wicket’s Ajax classes is depending on how your application/page is laid out it could drive you nuts trying to work around how Wicket “forces” you to work. If your page flow is small and simple you probably won’t have any problems.
And then there were Models
Models is what makes Wicket work. With Models you can “attach” any arbitrary data to a component and “detach” it once you’re done with it. There are some quirks with Models but once you learn how Models work, how to use them, which ones to use, etc things get a lot easier. What do I mean by quirks? Since some of the more commonly used models detach you could notice an increase in database calls since there is a call for when the page renders and the same call if any Ajax action is taken against the component. It’s by no means a show stopper since you’ll most likely be running Hibernate or some caching, it’s just one of those “ah-ha gotcha” things…. Now if your model requires heavy file IO you’ll have to use the correct Model or create your own.
Final thoughts
For me, the jury is still out on Wicket. It’s a neat framework that is definitely different from the rest. There’s a lot going for it and IMO the biggest hurdle it has right now is it’s still “new” and frankly there aren’t a lot of good books out there. In fact, the Wicket in Action book is the only good book and it’s two years and a full version old….