Joshua Java

In response to: Choosing a JVM Web Framework

Posted on: August 24, 2007

Matt Raible has written a blog entry on choosing web framework by categorizing it into types of application. He wrote 3 category:

  1. Consumer-facing, high-traffic, stateless applications
  2. Internal, more desktop-like applications that are stateful
  3. Media-rich applications that require a RIA framework like Flex

With these web-framework that falls on each category:

  1. Struts 2, Spring MVC, Stripes
  2. JSF, Tapestry, Wicket
  3. 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:

  1. Action based
  2. 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.

  3. 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.

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.🙂

4 Responses to "In response to: Choosing a JVM Web Framework"

I agree with the two categories. But I think a better way of filling them in is simply looking at their programming models. Component oriented frameworks are simply an abstraction higher than action frameworks. This sometimes makes them a little bit harder to work with initially, but they scale much, much better than action based (model 2) frameworks.

Regarding Tapestry5. I can’t comment too much on JSF, but Wicket 1.3 also gives you complete control over the URLs, and enables you to develop ‘stateless’ pages which together with deferred session creates makes that Wicket also can be a good choice for public facing web sites.

Regarding GWT… I would definitively place that in the component oriented category.

Flex and Open Lazlo are harder to put in any of these categories.

Hi Eelco, Thanks for stopping by🙂

I agree that GWT should be categorized as component oriented🙂 And about OpenLaszlo I agree too that it doesn’t fit in any of those category😦

Regarding Wicket, since I haven’t used it I can’t comment too much on it but a friend of mine complained about the URL that is generated by Wicket looks ugly to him.

You can control you URLs with Wicket in several ways.

There is a difference though between internal URLs and external/ bookmarkable URLs. Internal URLs, which are always relative to the session, can look like this: http://mysite.com/?wicket:interface=:1:link1::ILinkListener::
I guess you could call that ugly. But why would you care? These are not the URLs that are indexed by search engines nor URLs users might guess.

For bookmarkable pages however, you can use any URL scheme you like (http://mysite.com/category/books/year/2004 for instance). And as you can develop your whole application using just bookmarkable pages, it is really up to you whether you care enough to keep your URLs pretty and bookmarkable or whether in some cases you prefer speed of development.🙂

In Tapestry 5 even the URL that is generated by the framework is bookmarkable. Tapestry 5 generates http://mysite.com/category/books/year/2004🙂

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: