In response to Paul’s last post, “Struts is the new Mini”. Paul I can see where you are coming from, but choosing tomorrow’s winners from yesterday’s successes has never been a winning strategy in immature markets. Many organizations have already abandoned Struts 1.x. The only organizations left using Struts 1.x are the slower corporations, and when these organizations finally get around to moving to a newer framework they’ll have a variety of mature technologies to choose from (and a lingering sense that they probably don’t want to repeat the mistakes of Struts 1.x). The real question people using Struts 1.x are going to be asking themselves, is, “How did I get stuck with a framework that didn’t evolve?” We’re talking about software, and unlike my 1999 Camry LE, there’s no reason why software should be discarded after 160,000 miles.
Struts 2 and Brand Continuity
The Struts community took a revolutionary approach as opposed to an evolutionary approach - they didn’t try to launch series of incremental model redesigns in an attempt to create a seamless transition to the “Struts + WebWork (aka Struts 2)”. They’ve only recently realized this and they have some brand repair to do in the next few months. Shale was the real brand opportunity, and for at least a year or two, everyone was talking about “Shale is the new Struts, should we move to Shale?”. Shale didn’t gain developer support or customer traction, and, in the end, the customer demanded an evolutionary approach. In the world of brand marketing you don’t risk a successful brand by introducing too much change all at once. The Toyota Camry is a good example.
Toyota redesigned the brand incrementally (’92, ‘97, ‘02, ‘07) and made dramatic changes to the car without changing the basic interface, but because they took small steps, they’ve preserved the brand. As a consumer, you conceptualize the Toyota Camry as a single continuous product line, but at the technical level the differences between a 1999 Camry and a 2007 Camry Hybrid are dramatic. My 1999 Camry is (almost) a completely different model than a 2004 Camry, and an entirely different car from the 2007 Camry Hybrid. (And the styling differences between standard Camrys and the newer sporty Camrys imply a purposeful brand distinction) Even with these changes, if I’ve had a good experience with my 99 Camry, I’m more likely to just buy an ‘07 Hybrid. On the other hand, the differences between Struts 1.x and Struts 2 break brand continuity, and, even though Struts 2 is a quality contender, you should consider it a new entry on the market. Struts 2 and Struts 1 might both be considered family sedans, they both might have the same odometer and steering wheel, but it’s a different drive train and don’t just assume that you are going to take it into the same mechanic. Struts is the new Mini in 2004, and the analysts are withholding judgment until we get a sense of the resale value. And, admittedly, the interface for a car is much simpler than the interface to a web application framework (steering wheel, ignition, and gas pedal vs. web.xml, struts-config.xml, and JavaBeans), so the automotive analogy shouldn’t be carried too far. read on…
Shop around before you buy a Mini - they are expensive
Now is a better time than ever to sample the crowd of frameworks. (You can get a 2007 Stripes with no money down and no interest payments until 2009*). If you end up going with Struts 2, then more power to you. I’m sure Struts 2 is a fine framework, but it would be a mistake not to evaluate the market. Anyone considering changing web frameworks should try some of the following steps before making a decision:
- Try out Stripes and Struts 2 - Take a look at Stripes. Read Stripes vs. Struts by Tim Fennell. Then take a look at Struts 2. Stripes has a good following, and it was developed to address Tim’s issues with Struts. As you look at Struts 2 look at some of the responses to Struts 1 that are out there. I’m not suggesting either; I’m just recommending an objective search and a skeptical eye.
- Try out a Component-oriented Approach - Give either GWT or Tapestry or Wicket a try. Tapestry has been around longer than Wicket, but Wicket has great momentum. From my own experience, Wicket has very capable Ajax facilities that scale very well with increased complexity. The main disadvantage of a component framework for someone used to Struts 1.x is that it will take you some time to understand the approach. Once you do, it will make perfect sense. Don’t choose until you’ve taken GWT for a test drive.
- Try out a Scripting Approach: Use Rails or Django - Eventually, Rails is going to be an option on the JVM (whether you like it or not), evaluate it now and you’ll be able to make a more informed decision as this option starts to become a reality over the next few months. Also, don’t shy away from solving simpler problems with Ruby on Rails. Ruby on Rails is a great way to prototype and you might find that it frees up more time for you to tackle the interesting problems in Java.
- Read about ASP.NET and other platforms - I know you don’t like this, but check out the web application options from Microsoft, if you are building reports, look at SQL Server 2005 Reporting Services. I’m not recommending you adopt a Microsoft stack, and I don’t wish SQL Server on anyone. But, you need to be familiar with what the other half of the industry is using.
- Read about Java Server Faces - Another component approach. Personally, I have yet to meet anyone who is excited about JSF; on the other hand, I have met many people who are excited about all of the projects mentioned previously (including ASP.NET). Know that if you do want to use JavaServer Faces there is integration with Struts 2.
- Others - Please evaluate some other contenders, and do us all a favor, blog about them once you’ve given them a fair chance. If you are looking for a comprehensive list, read this.
Consider buying two cars
The answer to the question, “what framework do you use?” is no longer a single valued return parameter. It’s more of a “Well, my wife drives an Outback, but we have a Minivan for longer trips”… And, if someone asks you, “What framework we should use?” Your answer should include at least two values: “${action framework of your preference} for action-oriented systems, and ${component framework of your preference} for component-oriented systems”. Or maybe it should have three values, adding “${silly, Swiss army knife scripting framework} for prototypes and impossible last minute projects”. Underlying all of this is (likely) Spring, Spring has become the de facto standard for plumbing in most applications, and this has helped to disaggregate web application frameworks from persistence layers and services. Because every framework must integrate with Spring, it has reduced the upfront investment costs associated with switch between different web frameworks - you can switch to Wicket or Tapestry easily because you can just wire up your existing code (hopefully). There is no “One True Way” (except emacs and Spring J )
Unfortunately, that’s not how this industry works, instead what we tend to produce are single minded partisans who latch on to the first thing they learn and then start flame wars on O’Reilly blogs. A blog post like this tends to produce a series of impassioned fights over how RSF is better than Wicket, and how someone “doesn’t appreciate my agenda”. (Go ahead, scroll down after a few weeks, and you’ll see them. They’ve probably read the first two paragraphs and then decided to respond by saying, “Tim, you are ignorant because you haven’t used RIFE, don’t you know that RIFE is the answer to Rails”…Yes, I’m very ignorant, thank you….and, No, I don’t have an agenda.)
These days, I’m using…
…Rails for the simple prototypes, Spring MVC for a more formalized MVC in Java, and Wicket for the serious AJAXy web interfaces. (…behind the scenes, Spring for everything…) Wicket has really proven itself to be a valuable framework given some time. At first I was convinced that it was code heavy, but after giving myself a few weeks to grok it, I’m sold on the approach. In Wicket, banging out a Flash Video widget or some script.aculo.us integration is easy once you’ve digested the essence of the framework. Both Rails and Wicket lend themselves to AJAX, and I’ve found that it is easier to create mega-AJAX complexity in Wicket than it is in Rails - even with RJS. That being said, the only way to really know Wicket was to follow the example, there’s a lot of documentation but until you see the code in action, it won’t make sense to you.
In Conclusion
Trumpeting Struts because “that’s what I’ll need to find my next job” is a specious argument at best (argument to spurious similarity). It is an appeal to common sense that assumes that because Struts 1 was such a success Struts 2 must be the logical next step. Also, assuming that Struts is going to be around for the ages because of some built-up conceptual inertia assumes that we operate in an industry full of incurious corporate drones. Yes, there are a lot of organizations who play follow-the-leader on risky architecture decisions, but, at the same time, the “leaders” aren’t necessarily putting weight behind Struts 2.
The sad truth is that Struts 1.x is going to be around like an undead zombie for a number of years. There are a number of organizations that are going to take one look at Struts 2 and wonder if it even makes sense to take the jump. In the one to two years it takes most of these organizations to come to grips with the fact that Struts 1.x is going to affect execution speed and developer retention, we’re going to see a continued period of innovation in the web application framework space, and, IMO, this is a great thing, and this isn’t necessarily a zero sum game. The Wicket project has this table of the various web framework options, and there are many. Plan to evaluate a new web framework once every year for the next two or three, and plan to implement real applications on two different frameworks simultaneously.
(I disagree with Paul on this one, but he’s usually dead on accurate) K


Eventually, Rails is going to be an option on the JVM (whether you like it or not)
Or try Grails if you want RAD in your app container that will interact with your legacy code right now.
Tim,
Good response , including the turning around of the car examples to prove exactly the opposite of my argument - ouch :-)
You're correct in that people should be aware of the various web framework alternatives. Maybe it's a case of 'too-many-web-frameworks-too-little-time' , so the way I (maybe unfairly) cut the numbers down is the mercenary 'use in next job' test. At a purely technical level, there is little in your analysis that I can disagree with.
Now , if you're in a position to dictate / choose the web framework on your next project / job - great. (Un)Fortunately as Java matures and more and more projects become 'adapt this existing system' instead of 'build something new', the opportunities will become fewer. Taking this to it's extreme , it means us Java guys are the Cobol guys of the future - a true if slightly depressing thought if you've enjoyed the buzz around Java for the last couple of years.
Paul
Actually, I don't care much for the car analogy simply because it's not relevant. You're stuck with your 1999 Camry no matter what Toyota does. It's not like you can gradually upgrade to a 2007. Rather you have to replace the whole thing.
So, there goes all the window tinting, the custom stereo system, the aftermarket spoiler on the back and the flames your Cousin Fred painted on the fenders. The fuzzy dice tends to be a portable upgrade option, but beyond that, it's a complete rewrite when you upgrade to the new Camry.
The other point is that the interface to a new Camry may well be the same as the old Camry, but so is the interface to most every other car on the market (save the BMW 7 series with its wacky computer controller knob). So, Camry, Altima, Maxima, Accords, whatever...pretty much a wash (based on the fuzzy dice compatibility index no doubt, but that's always been hard to quantify). You could pick any one you like.
Now, if we're talking left hand drive, standard vs automatic, etc. then, sure, there's a bit of a learning curve as you go from an old model to a new model, but since you're a skilled driver, you're going to adapt fairly quickly as the environment that you drive in is not dramatically different. The functions you need to perform are the same: stop, (always learn stop first), go, left, right, park, swerve, tune the radio, etc.
Same with web frameworks. Any skilled web Java programmer should be able to pick up any other framework reasonably readily. Particularly if there are others available to ask questions of, or if there is working source code with good idioms and examples.
If you're a Struts Expert and asked to take on a position of designing a JSF project from scratch, you're probably not a good fit. But if you're a Struts Expert and asked to join a JSF project in progress, that's a completely different story, and a Struts guy is probably more than capable of filling that position.
So, I wouldn't get hung up on the frameworks so much. Pick one(s) you like, work with them, and master their idioms. Keep the fundamentals in mind (it IS, after all, an HTTP Request to a servlet at the core, no matter what), and master that relationship from HTTP request to the framework. Then, just worry about application design and all of the other issues that crop up with systems unrelated to the frameworks at all.
That is what makes you a better Java Web programmer, IMHO.
(P.S. What do I know about Camry's, I ride a motorcycle...;-))
No question - lots of viable options in Java Web Frameworks, including dynamic scripting Web frameworks.
Grails, JRuby (on Rails), JSF, MyFaces, Stripes, Struts 1.2.x/Streck, Struts Action Framework 2, Wicket, RIFE, Tapestry, and on and on and on...
It's good to have choices. And Java gives us that. In theory due to Java SE 6 scripting support on JVM beyond Java, PHP (on Rails) solutions may be of interest, Python (Django, TurboGears), etc.
I'm excited about JSF. I wasn't at first, and I wouldn't let a junior person use it without a lot of hand holding, but once you get it, you get it. Actually, I'm excited about Facelets and JSF, not so much the regular jsp version.
Struts does seem a lot like "Old Gill's" framework of choice (Simpsons reference). I miss it like I miss Nintendo and my Motorola v-60. I haven't spent any time on struts 2.
I do plan to take a look at Wicket and Tapestry, but to be honest, I think the "next job" argument shouldn't be completely ignored. I did a quick search on dice. Tapestry came back with 83, jsf 456 ('server faces' 390), struts 2073. Wicket? 6. I'm sure Wicket is great, but its been viable for about 2 years. 6 jobs. Even facelets came back with 19, and right now facelets is fairly obscure (and, unfortunately, will probably stay fairly obscure).
I guess I'd need to better understand the details of the different frameworks, but it seems like there are way too many of them. IMnsHO, Progress would be better served if, say, the wicket folks put their efforts whole hog into Tapestry enhancement, you know what I mean? Then you get the effort (development, design, testing) of the regular Tapestry people, plus probably some sweet add-ons and better design from the people who don't think Tapestry is perfect as-is. Then you also get serious momentum. I understand why the open source world would be less interested in JSF enhancement (although, I think JSF gets a much worse shake than it deserves), but why a whole new framework? On top of all of this, people tend to forget that a quality editor makes a difference. New frameworks require new editor integration, etc. Plus, corporate IT departments are going to consider that its going to be a lot harder to find a Wicket coder than a JSF coder (or struts coder, etc). That probably wouldn't be true, as there are many more people using Wicket because its cool than there are jobs to give those people, but you can bet few corporate-minded folk would take that gamble (longevity, support, training, etc).
I don't think I'll ever get the rails thing. I would assume that one could build a similar framework in the java language, so if you're doing mockups, you might be able to reuse at least some of the business logic that was flushed out during the mockup phase. A simpler framework? Sure. Different language? Hmm, not so sold on it. I read this...
http://www.ruby-lang.org/en/documentation/ruby-from-other-languages/to-ruby-from-java/
which seems to say that ruby's main benefit, besides personal preferences (brackets vs no brackets, etc) is less code. I guess I don't get it. How, exactly? That to me is an emperor's new clothes statement if I've ever seen one. You might have less lines, and you might abstract more out of the box (or not get all worked up about strict type conversions), but you're not really "working" less. You don't wind up with less logic definition, which is what a programmer does. In fact, I'd like to see statistics on code completion vs. full typing of a statement. I'd say at least half of my coding involves CTRL+Space. You can't really get code completion without types, right? You also need to run your tests to see that you might have a problem. When I code java, I see that right in the editor. Vague variable typing reminds me of javascript. If you want to find something that most developers aren't excited about, I'd put that up there next to Basic and Cobol. On top of all of that, you need to go back and re-code the huge body of work that exists for the other languages. DB drivers, common code libraries, etc. I will say Microsoft's plan with the CLI (after years of bashing Java's VM), takes a big step in the right direction.
FYI 183 dice jobs for 'rails'. 1212 'php', 7814 '.net', and 14536 for plain 'java'.
what is the control flow in a jsf framework
Don't forget about Grails.
@Kevin Galligan - Grails is like Rails for Java, and uses Hibernate and Spring etc...