Blogging Roller

Dave Johnson on open web technologies, social software and software development

The only solid argument for using WebWork over Struts?

One of the appealing things about Webwork is that Webwork actions are not tied to the web (i.e. the Servlet API) in the way that Struts actions are. You can use Webwork as a generic action framework, implement your business APIs as actions, and then re-use those APIs behind any UI technology: web, Swing, AWT, command-line, etc. You've probably heard WebWork advocates tout this genericity as a major advantage of Webwork over Struts. According to Anders Hovmoeller, writing to the WebWork mailing list, it is the key advantage of WebWork over Struts:

Anders Hovmoeller In my opinion, the only really solid argument for using WW over say Struts is that we are not locked up in a certain environment. I firmly believe that the core parts of XW can easily avoid being tied up to servlets, as WW does now.
But this is opinion is not shared by all WebWorkers. Rickard Oberg, the original architect of Webwork (who recently resigned from his position as architect of the project), does not see it that way. This is from a Jan 13, 2003 post on the Webwork mailing list:
Rickard Oberg That WebWork turned out to be a generic command pattern was more of an accident then by design. Because of this genericity WebWork is not optimally designed for doing web work. Some of the "plumbing" needs to be done by actions themselves, instead of having it be done by the framework. I want to make WebWork/XWork *better* suited for the web, because that is what *I* *need*. I want to get more for less. I don't give a damn about making it work well in Swing. If it does, then whaddyaknow, cool. If it doesn't, shit happens. If there's ever a point where I need to decide between "keeping genericity, or making it work better for the web", the latter is a given.
If you are considering using Webwork instead of Struts for your webapp, you might want to follow along on the Webwork mailing list to see where it is heading. Is it continuing along the generic "XWork" framework path or will it turn and become even more web-friendly?
Dave Johnson in Java • 🕒 04:59AM Jan 13, 2003
Tags: Java
Comments:

The fact that they can even have this discussion it a testament to how nicely designed and clean the code is. You could never have such a radical discussion about struts. If WW forked and died a slow painful death, 1.3 would still be a much better base for creating a web app than struts IMO. Just today I implemented functional testing in my app using httpunit. I didn't want any test code to have to be deployed to the server side (for setting up/tearing down), so I just set up the special ww servlet that allows my actions to be transported and invoked remotely, from the client test program. Now I have functional testing, with complete setup and teardown, and no test code in my server.

Posted by Steve Conover on January 14, 2003 at 07:45 PM EST #

I think that the key value of Webwork's abstraction from the Web Container is nothing to do with beaing able to use it in Swing. The key value is that your actions are *testable* The independance from the web container means that you can unit-test your actions outside the web container - quite a nice feature IMO. -Nick

Posted by Nick Minutello on January 14, 2003 at 08:13 PM EST #

I exaggerated a bit I must admit. Compared to Struts (and not other frameworks "say Struts", as I put it) WebWork is vastly simpler and more elegant to work with. But most of all, it is easy to model your application to webwork. I couldn't begin to count the number of times I have heard developers moaning of the sheer pain of trying to model his perticalar app to struts. WebWork being at the core unbound to the web is the foremost motivation to use it over _any other framework_, but from what I've heard (I am not a Struts developer) there are quite a few more reasons to use it if you compare it to struts. Btw, your blog doesn't like the o with an umlout I have in my name. The proper way to transcribe my name without this character is "Hovmoeller".

Posted by Anders Hovmoeller on January 14, 2003 at 08:15 PM EST #

I think that this is a little bit exagerated. I built a couple of month ago xPetStore, an implemention of Sun PetStore with open-source frameworks (mainly xDoclet). For the web layer, I choosed Struts over WebWork (I started initialy with WW). - WebWork is simpler, not tie with the web and thats really cool! - But, the WebWork-xDoclet integration was buggy while I have no prob with Struts-xDoclet - The expression language is very 'unatural' and error prone with [/] as separator instead of [.] as in Struts - The WW taglib has a strange syntax convention: sometimes you should enquote attributes values, sometime you don't, which is really confusing! - The code generated by taglibs is awfull. Is full of CRLF all over the place. Im sure I forgot other problems that i've encouter with WW. But, that was enought for me to switch to Struts, which has a much bigger community than WebWork. And the guy who lead Struts project is very close with the JSF team, so Struts-JSF integration will probably happen earlier that WW-JSF. Im not saying that WW is not a nice framework, but its not that good. And for a web-based projects, I'll pick anytime Struts over WW

Posted by Herve Tchepannou on January 15, 2003 at 03:29 PM EST #

*sigh* I have NOT resigned from WebWork. I repeat: I have NOT resigned from WebWork. I *did* resign from the position of architect of XWork. BIG difference. This FUD blog entry is just pointless and causes more confusion than is necessary.

Posted by Rickard on January 16, 2003 at 06:00 AM EST #

Post a Comment:
  • HTML Syntax: NOT allowed