This post originated from an RSS feed registered with Java Buzz
by John Martin.
Original Post: First impressions of WebWork2
Feed Title: The Lone Programmer
Feed URL: http://www.lonepixel.com/loneprog/javablogs-index.rdf
Feed Description: Just another lazy programmer. (Java and UI Design channels only.)
So I've spent the last few days checking out WebWork2, and I must say, I'm pretty stinkin' impressed. It's very well designed and very lean. I'm a complete newbie to the WebWork and OpenSymphony world (no experience with the original WebWork), but even with the sparse amount of documentation available, I found the learning curve to be much lower than Struts. Though, I suspect my experience with Struts gave me a big headstart in understanding WW2.
I won't diss Struts though, as I've had good success with it in the past. The last project I did with Cisco was Struts 1.0 and Tiles based (I love Tiles), and made heavy use of the i18n features. For the most part, it worked a charm, and we came away with a nicely architected solution. And hey, Struts is hot resume material these days. Anyway, back to WW2...
I love the distinction between WW2 and XWork (XWork is the generic command pattern framework that WW2 is built on top of). I don't know that I'll ever use XWork for anything but web applications, but the separation of the two makes absolute sense and is done very elegantly. And using OGNL for digging through data rocks.
Lots of other cool things: interceptors (which seems to be largely what WW2 is built as), the IoC framework, multiple view types (JSP, Velocity, etc) are equally supported, a very easy to use validation framework, no action beans or form beans (oops, I said I wasn't going to bag Struts), etc, etc.
I'm still a little confused as to what the normal/best way to handle the basic "prepare -> display form -> process form -> display result" sequence is. There seems to be some debate on the mailing list as to the future of the central action interfaces/classes (Action, ActionSupport, etc), so I'm curious as to what the final result will look like. (For any WW2 people reading this, I'm probably in favour of keeping an Action interface.)
One thing that I would really like is the ability to push URL's without suffixes through WW2, so my actions are accessed as:
/admin/category/add
instead of:
/admin/category/add.action
Doing this allows the URL to be a simple sort of command line, which I like. At the moment, the WW2 ServletDispatcher expects a suffix, and barfs if there isn't one there. Maybe fixing that problem will suffice. I hope so.
The other thing I miss is Tiles. I'm going to try out SiteMesh as a replacement.
It's been a big OpenSymphony week. Over the next few days I'm going to spend some angry hours doing something real with WW2, but I think I can say that I'm a convert.
BTW, Mike Cannon-Brookes has an excellent slideshow from the talk he gave recently at TSS Symposium. It's probably the best WebWork2/XWork overview available at this point.