In response to: Choosing a JVM Web Framework
Posted August 24, 2007on:
Matt Raible has written a blog entry on choosing web framework by categorizing it into types of application. He wrote 3 category:
- Consumer-facing, high-traffic, stateless applications
- Internal, more desktop-like applications that are stateful
- Media-rich applications that require a RIA framework like Flex
With these web-framework that falls on each category:
- Struts 2, Spring MVC, Stripes
- JSF, Tapestry, Wicket
- GWT, Flex, OpenLaszlo
I agree with him but with minor disagreement with the third category. Because really web 2.0 should be rich whether it is stateless nor stateful. We can add these richness to the webapps by applying AJAX and add CSS to it.
A friend of mine has said that basically there are two category for a web framework and I agree with him🙂. IMO the category should be narrowed to:
- Action based
- Component based
Web framework that falls under these category is: JSF, Tapestry, Wicket
Component based is a perfect choice if we have desktop in our mind. If user interface and event handling is much important in our application, if building custom components that is reusable then we should consider component based framework. I agree that internal application is much more relevant using these kind of framework.
Web Frameworks that falls under these category is: Spring MVC, Struts, Struts2, Stripes
Action based is a perfect choice if we have a web-ness/website in our mind. If URL and action navigation between pages is very important in our web application perhaps we want user to bookmark these URL then we should consider action based framework because we can defined the URL we want to display at browser address bar from the our application configuration. I quite agree with Matt that consumer facing or internet application that is accessed with high traffic is much more relevant using these kind of framework because we need a framework that enable us to defined the URL we want and thin layered between the servlet API so it won’t consume high bandwith. Also we add the richness by decorating our apps with CSS and applying AJAX.
Hey, what about GWT? IMHO GWT falls under the same category with JSF. If GWT is rich client, then where do you put Richfaces or Icefaces? What differs does GWT and Richfaces or Icefaces? I think this should go the same for Flex and Openlazslo too.
To be fair actually it is very difficult to categorize these frameworks as each frameworks sometimes overlaps one another.
Let’s take Struts2 as an example. Struts2 is action framework, but we can also build reusable components with Struts2 as it serves us with API to build our own/custom components. Also IMHO Struts2 is not as thin as any other action web framework if you have lot’s of interceptor configured in your web application. The more interceptor you have, the heavier it will be because it will need to go through all those interceptor first before the applicatin is ready.
And from the component based framework I’ll take tapestry5 as an example. Although it is a component based framework but it is not as heavy as JSF because it is very thin and it loads object lazily when it needs it for the first time. With tapestry5 now the URL that is generated is also very nice, making it suitable to be bookmarked. This also makes tapestry5 IMHO relevant for application that is accessed frequently or public web application.
So this is my opinion. The decision is on your side.🙂