Blogging Roller

Dave Johnson on open web technologies, social software and software development


JSR-241: Groovy!

Tags: Links

Why am I doing this Control Flow stuff?

Maybe I should explain why I'm wasting valuable late-night Roller development time with this continuations stuff. I'm experimenting with Control Flow because I'm frustrated with Struts (and other web-MVC frameworks) lack of support for building complex web applications where user-interactions extend over multiple pages. I'm tired of little ad-hoc tricks like session attibute here, request parameter there, breadcrumb stacks, and hidden fields that developers must remember to place on each page. There has got to be a better way and a continuations-based approach seems like it may be that better way. Ken McLeod explains the appeal of a continuations-based approach quite nicely:

<a href= "http://bitsko.slc.ut.us/blog/prevalent-continuations.html">Ken MacLeod: Continuation-based web frameworks let you write complex, modeless, interactive web applications in a top-down, linear fashion as simple as writing command-line based applications that prompt for input.

That sounds great, but I don't really want to switch to a new framework to take advantage of a continuations approach. I've got an investment in Struts and JSP and what I would really like to do is to learn from the continuations-based frameworks and, if possible, apply that knowledge to my existing webapps. What I would like to learn is:

  • Should you write entire webapps as "top-down, linear" programs, or should you just use a continuations-based approach for portions of webapps, perhaps only the parts that involve multi-page user-interactions. Charles Miller points out an important reason why you might not want to take the entire-app approach: webapps must be able to provide meaningful and bookmarkable URLs (cool URLs) and some continuations-based frameworks make this difficult.
  • Does it make sense to use Control Flow in the context of a plain-old web-MVC based framework (e.g. Struts, Webwork). How would you do this? Does the Control Flow script kick in before an Action is run, as part of the Front Controller, or after the Action completes?
  • Does it make sense to use Control Flow in the context of a next-generation web-MVC based framework with events and server-side UI components (e.g. JSF, Tapestry)? How would you do this? How should the Control Flow engine fit into the component request/response lifecycle?

There you have it. Please, leave a comment if you have any insight into any of the above questions.

Tags: Java

Prevalent Continuations

by Ken MacLeod
Tags: Links

Main | Next day (Mar 17, 2004) »