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!

Monday, January 05, 2009

Rapid Turnaround in Tapestry 5

Borut Bolčina has a screencast demonstrating live class reloading in Tapestry 5. And he's doing it with Jetty, in Windows ... so he includes the fixes to the environment to make this work (surprisingly, the problem is with CSS files, not reloaded Java classes!)

It's easy to dismiss how important live class reloading is; you tend not to appreciate how volatile the web tier is, or how often you are twiddling your thumbs (or reading blogs ... Hey! You get back to work!) waiting for redeployments and reloads. Live class reloading lets you explore your solution space a little bit at a time, without paying a horrible cost.

That's exactly what I do in live demos, or when teaching labs. I put a little bit into the template, a placeholder for what's coming. And I refresh the browser. Then I add some properties or event handler methods to the code, and components to the template. And refresh the browser. Then I start checking error cases and edge cases, making changes, refreshing the browser.

I often get runtime exceptions; usually there's a snippet of text (such as the properly spelled property name) in the exception page that I can paste into my code. Refresh the browser, and continue. Working incrementally this way is faster and easier, with less waste and frustration.

You get used to this style very quickly and then the thought of going back to an environment that doesn't support it (Struts, Tapestry 4, even Flex) is disheartening.

6 comments:

Mandr said...

Yes, this is pretty handy. We use it a lot in our projects. It would be nice if live class reloading is also supported for tapestry-ioc services. Is it doable?

Gabriel Kastenbaum said...

I do agree with that. Php is very good for this, you can work quickly. Not as with Struts, jsf, etc...

Phil Zoio said...

Impala has an example application with dynamic reloading with various web frameworks including Tapestry. See this wiki page.

The integration with Tapestry would probably need a bit more work. However, the nice thing is that reloading is not limited to Tapestry classes - any part of the app can be reloaded.

Ken said...

that's one reason I like working w/ ASP and ASP.Net (which even dynamically loads DLL modules used by your site)...

Unknown said...

I would really love to see this for services. Since T5 helps us to reduce the work on the presentation layer, we find ourselves often working on the services and there the frustration kicks in making us wish for a way to avoid restarting the app.

Unknown said...

Tapestry needs to create its own class loader to do reloading; this is very intrusive. Less so for Tapestry pages and components, which are all instantiated by Tapestry and communicate with each other, but there's already leaky abstractions when you want to pass a component to a service (and get a ClassCastException). Adding reloading at the service layer would tend to make the IoC code non-interoperative with any code that isn't live-reloading.