Wednesday, July 26, 2006

Tapestry Overview

When I was primarily doing struts and jsp development, I remember reading all these stellar Tapestry reviews and feedback, and was really planning to look into it a little further. In a few instances, I did look into the regular examples that were out there; however, at the time, I was not particularly impressed with it (that was before I looked at JSF). I mean that the syntax seemed to be pretty straightforward; however, there were all of these page and component definition descriptors that seemed to make things so much more verbose ( in a retrospect, I have to admit that at the time I was definitely not getting the idea of what a component oriented framework was all about).

So, maybe a year ago, I was a bit bored with what I'd been learning at the time ( I was kinda stuck in a rut and didn't seem to be learning much beyond the standard Struts/JSP stuff). So, I decided to learn about JSF, since it was a Java standard that seems to be pickup up speed pretty nicely. So, I sat down , read a couple of books on JSF and implemented a couple of projects with it at work and at school. It was definitely an improvement over Struts and a good learning experience. However, along the way I got to learn a couple of the not-so-savory sides of it as well. One of my biggest compaints is that it really smelled of a framework that was designed by a committed : the really simple stuff worked really nicely, it was easy to pick up and learn about; however, as soon as you started doing something not trivial (and I do mean it, not simple, but definitely not difficult stuff - e.g. selecting a row from a data table), you were immediately going up the creek... Although the framework was supposed to abstract you from the http implementation, I found myself having to deal with sessions, http requests and params, almost the same as struts... Somewhere along the way, I encountered Facelets, which was definitely an improvement over the standard JSF implementation and it was then when I realized how nice it was to have plain html implementation of the view using an extra html property for the tag to indicate framework components.

So, about a month ago, after listening to a JavaPosse interview of Howard Lewis Ship I finally decided to really give Tapestry a go. And so far, my impression is "WOW, what a refreshing and nice way to develop web apps". Although, there are a couple of things to learn from the get-go about how to start writing a Tapestry web app, after the initial slight learning curve, writing an app is really, really nice and easy. Especially now that with Tapestry 4.0 the xml descriptors can be by Tapestry annotations inside the actual page or component class makes it a less verbose.. Overall, the impression is that Tapestry came out of a practical need and evolved fulfilling all of these practical needs to make web app development more predictable and productive. Additionally, unlike JSF, Tapestry is not trying to do too many things in addition to simplifying web app development (e.g. JSF is trying to be able to have different view implementation by switching view handlers to do html, wml, and telnet). Thus, Tapestry is not unnecessarily complicated by 'possible' problems that one might have to solve when implementing web apps.

In summary, I will probably try to see what else Tapestry has to offer. So far, I really haven't have had to deal with any of the standard http/web protocols and it has been so wonderfully handled by the framework. The other day, just in a few hours, I was able to reimplement a struts app with Tapestry in a few hours. Additionally, what would have been really messy to implement before was really easy now and I found myself implementing new features that I had been thinking about in a very long time but never went ahead with it because of the mess I'd have to deal with had I had to do it in Struts. The only problem that I have encountered so far was that when I was deploying a tapestry app in JBoss 4.0.4RC1, it was giving me some errors due to the hivemind libraries being loaded multiple times (not a problem in Tomcat, as JBoss has a funny way of handling classloading). Finally, the 4.1 Tapestry release, promises a whole bunch of AJAX features that only vendor specific JSF implementation like Oracle ADF seem to offer ) and I'm really looking forward to seeing what it will bring to the table.