Tapestry Training -- From The Source

Let me help you get your team up to speed in Tapestry ... fast. Visit howardlewisship.com for details on training, mentoring and support!

Friday, July 30, 2004

.Net vs. Struts ... and the winner is Tapestry!

Just something I noticed on the Cardsharp on Software blog:

Tapestry from the Jakarta Project. Yes, it's not JSF. Yes it's "non-standard." Yes, it requires you to learn a new library and a new way of doing things. But it's better. Far less configuration than Struts, and what is there makes sense. Instead of a jumble of disconnected concepts, the whole library is built around an event-driven mental model that just makes sense. Things that would take me 5 lines of code in Struts take one or two in Tapestry. Imagine being able to tie an event handler in a Java class to a link or a button with no configuration file changes! Think about forwarding to a new page and passing objects to the "action" by setting properties on it istead of hucking everthing into the request or session. Think about how much you like Tiles and imagine what it would be like if everything was a tile, but didn't require all the verbose <tiles:put> lines just to set parameters on your tiles. Think about all those times you'd wished you could put custom configuration information into your <ACTION> tags in the struts-config.xml (especially if you've tried to customize it using the <set-property> nonsense!). Think about how nice your life would be if your ActionForm and your Action were actually in the same class in a way that made sense, and think about how nice it'd be if the framework implemented all the getters and setters for you. Think about implementing complex interactions without jumping through all kinds of hoops to manage the state of your page.

And I'm only scratching the surface here.


Ben said...

I am just starting to use Tapestry after being a Struts guy for a couple of years. I am very impressed with the power, but am equally impressed with this bit of simplicity:

1) Put jars in classpath
2) Edit a simple web.xml
3) Create a Home.html in your web context

You are now using tapestry. Why is this a notable item to me? Because often times the hardest step to using a framework is the first step. This also demonstrates that Tapestry will not only benefit the powerful dynamic site, but the normal static html site as well. The PageService with its @Span and @Border components take the framework to a very pragmatic level.


Ben said...

Oops, not @Span... @Shell

Kame said...

> Think about how much you like Tiles

Well, I don't think it's great for Tapestry to be praised by JSP includes with a bunch of XML (aka Tiles) lovers. Tiles is as kludgy as much of Struts 1.2, fully procedural and doesn't deserve worshiping. Not like Tapestry :-)

Cardsharp said...

As the author of the original post, I have to somewhat agree that comparing Tiles to Tapestry is a slight to Tapestry. However, many Struts fans will concede that Tiles is possibly the best part about Struts and even though it's technically only a "related" project, it's still very useful. The Tiles project has saved me an enormous amount of time and if you're trapped in the Struts world you'd be remiss in not checking it out. Also, saying that it's not object oriented means that you haven't looked deeply enough. A tile is a page object defined in a configuration file. It is self-contained and can be backed by a Java class that acts as the controller for the tile. In that way tiles is VERY similar to Tapestry. It's just that tapestry is far more sophisticated and takes the ideas to the next level. Tiles is a great technology and comparing it to Tapestry is high praise for Tapestry indeed.