As I mentioned, in my last post, we are evaluating web frameworks at the office. Seeing as all of our current web-app development is done using Struts 1, we thought it would only be fair if we first looked at Struts 2. I also mentioned in my previous post that we have some basic criteria by which we are evaluating these tools. This evaluation took place on Friday, February 29th, with two of my coworkers.In case you’re wondering, Struts 2 is a significant departure from Struts 1. In fact, it’s totally different. If you’ve ever used WebWork then you’ll be at home in Struts 2 because it’s basically WebWork renamed.How did it stack up against our criteria?
- 10 Minute Rule - Unfortunately Struts 2 failed miserably here, but it’s not all the framework’s fault. Because of some of our other evaluation criteria, namely “Convention over Configuration”, and “RESTful”, we had to use the current development version of Struts 2 (2.1.1 I believe), not the officially blessed version (2.0.11.1 at the time). This meant we had to download, and compile the source. In order to compile the source we had to have Maven. All of our tools are currently built using Ant, so we had to download Maven. Oh, and by the way when we used Maven to build Struts 2 it downloaded the entire Internet onto my workstation while resolving dependencies. We did however eventually get it built. Let’s just say it took a bit longer than 10 minutes to get compiled jars, not to mention running code. However, once we got past this initial hurdle we were able to use the REST showcase application (I’ll mention it more later) to get up and running quickly.Grade D (Maybe C)
- Convention Over Configuration - Once we got everything compiled and running Struts 2 really shined here. However, I should note that this is not necessarily stock behavior for Struts 2. We made use of the Codebehind plugin in order to achieve this (note, it’s also required for the RESTful stuff). Basically if you name things a certain way and put things in the proper places Struts 2 will “figure out” what to do. In our afternoon of playing it worked great. It may also be worth noting that the Codebehind plugin was yet another thing we had to download, and compile, thus further slaughtering the “10 Minute Rule”.Grade A
- Tool Support - This one is a bit of a no brainer. Struts 2 is all Java, we’re an all Java shop with a great IDE. So, we didn’t have any issues here. It’s probably worth noting that all of IDEA’s Struts specific features are geared for 1.x. However, I find most of those features pretty useless anyway, your mileage may vary.Grade A
- Developer Resources - Maybe it’s just me, but I thought that most of the Struts 2 documentation sucked. This probably has something to do with the fact that we were using developmental plugins and an edge version. I’m sure if I took more time to read I would have had a better experience, but as we were rushing to accomplish something in a day I didn’t find the docs much help. On final thing to note about documentation, when you are looking at plugins it can be very confusing as to what plugins do what, what requires what, how one is different from another, etc… it’s a bit of a mess. Seeing as this is Struts we’re talking about I’ve got to believe this stuff will keep getting better as more people move to Struts 2.Other things of value to note here, a simple Amazon search shows that there are a number of Struts 2 books (not sure if any of them cover RESTful stuff). Also, it’s an Apache product so there’s going to be conference coverage.Grade B
- RESTful - Once we got the REST plugin downloaded and compiled this was seamless. The REST plugin comes with a showcase application that serves as a good reference for getting up and running. Most of the RESTful stuff just happens. It’s really nice.Grade A
- Access to Java - Struts 2 is written in Java, it obviously runs in the JVM, nuff said.Grade A
Overall I was satisfied with Struts 2. Aside from the things already mentioned the only major concern I had was the constant feeling that “this ain’t quite ready for prime-time”. Again though that’s mainly because of the desire for “zero configuration” and “REST”. If those things are not requirements for your project, and you can use the current release version of Struts 2 you’ll probably have a decent experience.