Code Junkie
Code Junkie

Reputation: 7788

Spring3 vs Tapestry 5.3

I'm currently trying to compare Spring3 with Tapestry 5.3. I've been a Tapestry user since 2003, so I tend to have a bias opinion and only because I have no experience with Spring. I'm seeing Spring become very widely adopted by most companies writing java apps, so it has forced me to take a look at it for my new web app. My current objective is to build a very rich javascript application with little configuration and a wide array of available components. My biggest complaint with Tapestry5 was the fact it was designed to work with the Prototype library.

Could someone please provide me with the positives and negatives to Spring3 and potentially why a company would chose to build in Spring3 over Tapestry5? I've searched google and it appears the only comparisons I've found are dated. Thanks.

Upvotes: 1

Views: 5212

Answers (1)

Sotirios Delimanolis
Sotirios Delimanolis

Reputation: 279990

I had to do a small proof of concept for the company I work for. I looked at both Spring MVC 3 and Tapestry 5.

For those who haven't used Tapestry, it has really nice conventions for UI flow, eg. buttons pressed or following links. It's also nice that everything in your Page class is ThreadLocal so you don't have to worry about concurrency at that level.

On the other hand, I didn't like the support Tapestry had for Ajax. It has its own tags for performing ajax operations (zones, etc.), but it's hard to do

$.ajax({
  url: "tapestry_page",
  success: function(result) {
    // do something with json result
  }
});

because of the return types accepted by tapestry. You said your project will be javascript rich and this might mean a lot of ajax. For that reason alone, I would go with Spring. You can just annotate your @Controller methods with @ResponseBody and anything you return will be written directly to the body of the response. This is useful for writing json or xml directly (which, in most cases, is generated automatically with Jackson or JAXB).

With Spring, the biggest positive is that it's a very mature project and so everything you need, someone probably needed it before you and a solution is available (not that the same isn't true of Tapestry, but more documentation exists for Spring).

A few negatives for Spring: it's very closely coupled to the Servlet way of things, doGet and doPost and things like form handling aren't done as cohesively as in Tapestry's form lifecycle. If you're doing a lot of synchronous operations, Tapestry's Page concept is very nice and maybe the way to go.

I'm not sure if Tapestry has achieved the point where you can configure your whole app without xml, but Spring has. That might be an advantage for you.

My 2 cents.

Upvotes: 9

Related Questions