Tapestry 4.0 support in AppFuse's CVS
I spent the last couple of days upgrading AppFuse from Tapestry 3.0.3 to Tapestry 4.0.1. While the integration isn't as clean as I'd like it to be, everything works and all tests pass, so that's good. I did post a few remaining issues to the Tapestry mailing list, but there's nothing major. While the upgrade was frustrating (it took me 4 hours to figure out I needed "validators" instead of "validator"), I feel I know a fair bit more about Tapestry now. Furthermore, my experience on the Tapestry user mailing list was incredible. Yesterday, for every question I'd send, I'd get 2-3 replies in a matter of minutes. It was like having my own personal Tapestry consultant by my side. It goes to show that Tapestry is a thriving community, with a lot of folks willing to help out. Thanks guys - I really appreciate the help.
Update: You can view the FishEye Changelog to see what the upgrade entailed.
Posted by Chris on April 01, 2006 at 12:35 PM MST #
Posted by Matt Raible on April 01, 2006 at 04:14 PM MST #
Posted by Jeoff Wilks on April 05, 2006 at 08:31 PM MDT #
Regarding Session storage, it is fully configurable. Using the session is the easy way, but you can easily conceive stateless applications using the 'client' storage type rather than 'session' on page/component's property (i.e. store the object id on the client on a hidden field or a query parameter rather than the id in the session).
Good documentation on the tapestry site regarding server state: http://jakarta.apache.org/tapestry/UsersGuide/state.html
On the bookmark management side, the logic here is relying on a specific Tapestry 'Service', called External Service, which allows you to point to a page with a series of (named or ordered) parameters of type: http://website.com/xxx/app/Product.svc?productId=123 (all this is stateless).
In addition, since Tap4, a 'Friendly URL encoder' brought a very elegant way of customising URLs look, so that the most dynamic page can look as a static page URL. More reading there: http://jakarta.apache.org/tapestry/UsersGuide/friendly-urls.html
Hope this helps,
/H
PS: I have personnaly gone with Tapestry after using CGI, my own framework, Struts, proprietary BEA, and I can say that it is very elegant. Furthermore, and it is my own personal opinion, I think that HiveMind, an IoC container upon which Tapestry is built, is very powerful and replaced in my application the famous and very good Spring container. A bit of learning curve, well well worth it.
Posted by Hugues on April 05, 2006 at 09:43 PM MDT #
The biggest single tip is to use external pages and external links as much as possible. These links, and pages, are specifically designed to be "bookmarkable". So, if you want any page in your app to be bookmarkable, then you would want all of your pages to implement IExternalPage and to use external links throughout.
Posted by Robert Zeigler on April 05, 2006 at 09:44 PM MDT #
The relevant excerpt from that link you provided regarding client-based state storage is:
"Client properties are stored on the client, in the form of query parameters. All persistent properties for each page are encoded into a single query parameter, named state:PageName. The query parameter value is a MIME encoded byte stream."
That's really not what I had in mind; I'm looking for more of the classic HTTP/REST approach: filesystem-like paths, redirect-after-post on forms, all non-sensitive properties displayed in individual query parameters, etc. It sounds like I would have to use External Service / IExternalPage / external links everywhere. My gut feeling is that this departure from the modus operandi would pit me in a battle with the framework at various times, since it's not the way the framework authors expected it to be used.
However, it's nice to see that Tapestry 4 is now placing more emphasis on Friendly URIs. I will watch it with increasing interest, especially as the framework continues to move toward giving URIs first-class status.
Posted by Jeoff Wilks on April 06, 2006 at 12:09 AM MDT #
I think you are very true in assuming that Tapestry does its little magic in its own way, i.e. you do not have, by default, full control on how things are made easier on the development front.
However, with HiveMind, Engine Services and Service Encoder (a.k.a Friendly URLs), you can accomodate much of your URL formatting needs. For my own project, I have developed my own Engine Services, with their specific encoders (all stateless BTW). The parameters I pass to the service are named and you are not forced to follow the pattern: state:PageName="...". All this is seamlessly configured using HiveMind. And you keep the historical beauty of Tapestry, which is the clean, simple and powerful development through components.
The only thing I have to say is that, despite much effort from Howard and the guys on the Tapestry team, there *is* a learning curve. It is not CGI development, there are predefined rules (and you can override them through configuration) and an original way of doing things, and if you come from a different background with your own habits (like I did), well, you will surely have to lose some of them. But what a reward, at least for me, because I have with Tapestry and HiveMind the basis of all my developments.
/H.
Posted by Hugues on April 06, 2006 at 07:25 AM MDT #