Comparing the Big 5 Web Frameworks
My session at ApacheCon is titled Comparing Web Frameworks: Struts, Spring MVC, WebWork, Tapestry & JSF. I have to turn in my presentation by Friday. The purpose of this post is to get your feedback and see what you'd like to see in such a talk. Here's the abstract:
This session is designed to explore the popular Java web frameworks. It will briefly explain how each one works and the strengths and weaknesses of each. Tips, tricks and gotcha's will be plentiful. A simple web application will be dissected and the different options will be compared. Lastly, it will provide attendees with a sample app they can download that has options to use any of the frameworks described.
The simple webapp is MyUsers from Spring Live. As part of my gig with Open Logic this summer, I wrote a number of sample apps using Equinox. Among these where 1) a Mavenized version, 2) a Tapestry version, 3) a JSF version, and 4) WebWork version. The Struts and Spring MVC versions were already done as part of the book. They agreed to let me use the code and knowledge from that experience. This is all to say it shouldn't be too hard to create the sample app for this talk.
The hard part is going to be talking about things that developers care about. In my post on JSF a while back, I noted the things I typically want in my webapps. The following topics might make good points of discussion.
- A sortable/pageable list of data. It's possible, but you have to add special sorting logic for each class. JSP already has this with the display tag - I'd simply like to be able to use it in JSF.
- Bookmarkability. Container managed authentication gives us a great way to offer users the ability to bookmark pages. If everything is a POST with JSF, we lose this ability. Sure there's the HTMLOutputLink, but if we can't invoke actions, what good is it?
- Clean and easy to read validation messages. The validation messages in both MyFaces and Sun's RI are not something you'd deliver to customers. What's wrong with making clean messages out-of-the-box? Tapestry seems to have no problems doing this. All the other MVC frameworks make you specify your own - which is fine with me.
- Easy cancelling and multi-button form handling. JSF does this well - better than the rest I'd say.
- Easy testability. Because of the plethora of JavaScript, JSF apps are difficult to test with tools like jWebUnit and Canoo's WebTest. Don't get me wrong, I love JavaScript - but an application should be able to be tested w/o it.
- Success Messages. JSF does success messages OK - it's a pity it's not easier to get a resource bundle and it's a shame that you can't escape HTML in the <h:messages> tag. This seems like an oversight to me.
I could do a number of slides and show how each framework handles the above situations. Other topics that would be worthwhile would be:
- Model in View - can you use your model objects to back forms or do you have to use something like ActionForms?
- Spring Integration - all of them have this. This would merely be a discussion on how its handled.
- Validation - how robust and/or extensible is it? How hard is it to do chained validation? What about client-side validation? Is the client-side stuff immature like WebWork's?
- Internationalization - how is it done and how hard is it to get messages in your classes? JSF sucks at this.
- The Duplicate Post Problem - how does it handle duplicate posts. Not the "push the submit button twice" but the "hit refresh after saving" kind. Tapestry fails this test.
- Page Decoration - SiteMesh can be used for all frameworks, Tiles for some. Discuss how much easier it is to use SiteMesh.
- Tools - since some frameworks have tools to help ease there development and others don't.
- Business/Marketing - how well known is the framework and will your skills be marketable if you learn it? JSF and Struts are in high demand. Tapestry is virtually unheard of. WebWork is for the evil few (heh!) and Spring MVC is the new kid on the block.
Whaddya think - what is so special about your framework that'll make it look better in my talk? What are the things that suck that I can bash on? If you're a committer on one of these frameworks - are you going to be at ApacheCon? I'd love to have some folks defend their projects after I'm done ripping on them. If I don't rip on yours, then you can bask in all its glory.
If you live in Denver, I'll be delivering this presentation at DJUG's Architecture SIG on November 3rd.
Posted by Francisco Hernandez on October 13, 2004 at 06:44 AM MDT #
If this is a topic you feel is mundane or boring, let me know and I'll zap it.
Posted by Matt Raible on October 13, 2004 at 06:51 AM MDT #
Posted by Matt Raible on October 13, 2004 at 06:52 AM MDT #
Posted by Francisco Hernandez on October 13, 2004 at 07:32 AM MDT #
Posted by Carlos Sanchez on October 13, 2004 at 09:24 AM MDT #
Posted by Vítor Souza on October 13, 2004 at 12:38 PM MDT #
Posted by Torgeir on October 13, 2004 at 12:43 PM MDT #
Posted by Gary Blomquist on October 13, 2004 at 01:08 PM MDT #
Posted by Erik Weibust on October 13, 2004 at 04:22 PM MDT #
Torgeir - redirecting after POST is my preferred solution as well. This doesn't work so well in some frameworks. For example, with Tapestry you have to throw an Exception and from my experience, that still doesn't perform a redirect/GET request. A fair amount of the frameworks have support for saving success messages, but only Struts has built-in support for allowing these messages to survive past a redirect.
I'll try to post an outline and feature list for the sample app tomorrow.
Posted by Matt Raible on October 13, 2004 at 04:39 PM MDT #
Posted by Bill Siggelkow on October 13, 2004 at 04:44 PM MDT #
Posted by Mike Foody on October 13, 2004 at 05:10 PM MDT #
Posted by Ted on October 13, 2004 at 07:43 PM MDT #
.V
Posted by Vic on October 13, 2004 at 08:05 PM MDT #
I thought the "Invalid direct reference" problem in CMA hindered the ability of users to bookmark login pages. I've been using security filter instead. Can you explain what you mean by this comment?
Posted by Brian on October 13, 2004 at 08:39 PM MDT #
Posted by Winston Rast on October 13, 2004 at 09:43 PM MDT #
A 2nd vote for the input grid of N rows of data input and complex forms.
Possibly related to the bookmarkable and duplicate-post criteria: does the framework break the browser's back button? If the user is entering multiple similar records, can they use the back button, change a few items and submit without errors? Or same story with a meaningful error message?
How much control over the design of the URL does each framework offer? I know that all URL design problems can be solved by mod_rewrite, but suppose mod_rewrite isn't available for some installation. What does the framework let me do?
To what degree do the frameworks separate these concerns: Workflow, Action, Representation, Storage?
see also: http://today.java.net/pub/a/today/2003/12/11/mvc.html?page=3
Posted by Eric Dobbs on October 13, 2004 at 10:59 PM MDT #
Posted by Jason Carreira on October 14, 2004 at 12:36 AM MDT #
Posted by SUJAN SHRESTHA on October 14, 2004 at 01:13 AM MDT #
Posted by Bill Siggelkow on October 14, 2004 at 02:17 AM MDT #
Posted by Jeff Duska on October 15, 2004 at 03:01 PM MDT #
Posted by Matt Raible on October 16, 2004 at 05:48 AM MDT #
Posted by Matt Raible on October 16, 2004 at 05:49 AM MDT #
The time you've spend writing this post is already worth the time to get you on Rails. :)
No fancy whitepapers or enterprise patterns pissing contest here. Just a compact (about 1kloc), intelligible and highly introspective piece of code. No need for redundant declarations (struts-config.xml, anyone?), it's all in the code. At last, here's a framework which do not try to reinvent the wheel by creating some sort of web abstraction layer and which will help you build stuff according to the standards of the web platform as defined by the W3C; and those are not going to dramatically change anytime soon...
Programming language apart (I presonally would have prefered Python over Ruby), Rails is the only web framework I've seen so far which has been designed by people doing actual web development and not some wimpy bowtie-wearing COBOL programmer who had to switch to Java web programming after a two week bootcamp at Sun Training Center.
I urge everyone interested in web frameworks to have a look at Rails. You'll just get desperate to see how clumsy the Java world has become while others are getting to job done with their "toy languages".
<cite>?There are two ways of constructing a software design: One way is to make it so simple that there are obviously no deficiencies, and the other way is to make it so complicated that there are no obvious deficiencies. The first method is far more difficult."</cite> (Tony Hoare)
Cheers!
P.S. : Stop complaining about Ruby' (supposed lack of) "scalability" already, please. I'm talking about framework architecture, here. We are in 2004, scalability is more of a system issue now, otherwise you guys wouldn't be using Java, would you? I do also know that your boss just like mine will never bet his seat on something like Rails eventhough it could spare the company hundreds of hours of development and maintainance time.
Posted by Xavier on October 17, 2004 at 10:25 AM MDT #
Posted by Lian Guan on May 25, 2005 at 05:42 PM MDT #
Posted by Henning Meinhardt on June 02, 2005 at 02:24 PM MDT #
Posted by Henning Meinhardt on June 02, 2005 at 02:25 PM MDT #
Posted by 81.155.96.27 on January 18, 2007 at 04:27 PM MST #