Tapestry in Action

On a very long flight to Germany and back I started digging into Howard Lewis Ship's book Tapestry in Action. I am very impressed with Tapestry so far. It does have a fairly steep learning curve compared to your more typical request/response frameworks such as Struts and Spring MVC. I attribute this to two main points:

  1. 1. Tapestry uses more of an event driven programming style rather than the more familiar web style request response which makes the overall programming model closer to regular GUI programming. The tough part for me as a web programmer is that I tend to think more in terms of request response so this required a bit of a shift in the way I think when develping with Tapestry. I'm told JSF is similar in this regard.
  2. 2. Tapestry uses its own templating language (which reminds me a bit of Enhydra's XMLC). I really like it because it's non-invasive unlike JSP. Once you've worked with one templating language for a while though (in my case JSP) switching to a new one takes time.

People tend to evaluate MVC frameworks (and software in general) based on what is easiest to get up and running with the fastest. I'm not convinced this is a sound approach though. It may be fine when your developing a simple page for a personal website. However, once you throw in a lot of complex requirements such as internationalization, complex client and server side validation, cobranding, etc… the framework that solves the complex requirements in the simplest and most elegant manner is going to be more cost effective in the long run, even if the up-front learning curve is steeper.

Things I'd like to see in Tapestry are resources that can be shared among pages and cleaner search engine friendly URL's (although that's a general gripe I have with the servlet spec as well). I don't think URL's are a showstopper though since on a real project I would probably just use Apache to transform a search engine friendly url like http://x.com/product/id/1234 to http://x.com/product?id=1234 for the servlet container.

With regards to the book I think Howard does a good job overall. The hangman sample application was interesting and illustrates Tapestry's elegance and power, however, I breezed through it to get to form handling since that's more relevant to the type of work I do. In summary, with very clean non-invasive templating, a nice per page XML file, graceful form handling and validation, internationalization, etc… Tapestry is definitely in the running for me as my MVC framework of choice. I now just need to get more real-world implementation experience with it.

This entry was posted in Java. Bookmark the permalink.