Sunday, June 24, 2007

reasons to love wicket

I spent about 12 hours over the last few days working with wicket framework. Some background- I've used struts etc for too many years, tried flex, jsf, webwork, and tapestry. I think for most applications wicket is the right tool for the job. I am very impressed. I have built some ajaxy forms, used the tabset, and done layout reuse, tables with nested gui controls. Here's some coolness:
  1. Use any model you want. If you use DTO pattern, or direct binding to domain objects, wicket will bind the UI components to them. No need to convert a struts form into a dto, or a backing bean into a dto. In my case I'll be binding to a DTO since I think having the UI build/manipulate domain objects, beaks the idea of a service layer.
  2. Work with UI folks. Like tapestry, wicket imposes minimal needs on the template, such that UI designers can easily modify things.
  3. Related to #2, I have yet to need a scriptlet, or jstl. (Add that in the plus column for learning curve)
  4. real re-use. Using every other framework, reuse at the UI layer has been nearly impossible, or at least broken. In struts you could re-use forms, but ended up copying jsp crap around. In wicket, you can make subclasses of existing components (like a panel) that contain your bus specific version of it.
  5. Layout "including". In about 15 minutes I was able to chop up my page into a "body", "footer", etc.
  6. Do all the above with just a few artifcacts. Java classes, and an html template. No xml, no annotations.
  7. ajax support. I ajaxified a few form elements within minutes. No need to rip open a dwr.
  8. 2 jars. Yep, no jar hell here, just drop in the wicket jar, and maybe the wicketextensions jars... (you already have log4j in your project anyway...)
  9. No servlet api. Some might think this is a con, but in 2 days I have had no need for sessions, requests, and application contexts. I'm not lost trying to find where the code is that puts that model object into some scope. Yeehaw.
  10. Validation- very good provided validators, and it is easy to find them. Just look at the java code where the component is created!
  11. Excellent examples and docs. Wicket site is a little disorganized, but there are non-trivial examples for 95% of what you'll need... a good book in apres press... and some good stuff on the wiki
  12. Mailing list- seems monitored by some really smart folks who are committers
  13. back button, bookmarkable links. Looks like the wicket guys have you covered. Haven't tried breaking my app with back buttons yet, but looks good.

So what are you waiting for! Stop complaining about your web framework and use one you can actually love.... Sure there is some learning curve, but it is well worth the lean, elegant code you'll be maintaining, as opposed to the rats nest created by most of the others...

1 comment:

Jonathan said...

Thanks very much for all the kind words.