The Elevator Pitch for Web Based Continuations

Share the article!

From Avi Bryant:

Dijkstra may have taught us 45 years ago that GOTO was a bad idea, but web development has barely caught up. In the CGI model of web applications, each link that is followed triggers an entirely new execution of the program. Building complex control flow out of these abrupt transitions can lead to a tangled and brittle mess of interdependent pages. Modern frameworks such as WebObjects and Struts may remove many of the difficulties of CGI scripting, but they do not escape the web’s inherent GOTO: moving from one page to the next, whether through anchors, actions, forms, or forwards, is still a simple one-way jump.

Seaside is a framework for developing web-based applications that insulates the developer from the HTTP request/response loop, presenting the illusion of a continuous interactive session with the user. Each page or form acts much like a subroutine, which returns a value to its caller based on user input. Complex, conditional or looping workflows can be described in a single piece of straightforward Smalltalk code as a sequence of calls to individual pages. The benefits this brings to the reusability and maintainability of web applications closely mimick the advances made by structured programming long ago.

About a year ago, I blogged about the Rhino implementation of continuations and its application to web frameworks. Recently, Ovidiu Predescu presented a set of slides updating everyone of its progress.

It turns out the Smalltalk community has picked up on this idea and has implemented Seaside a continuation based framework. The Ruby community impressed by the idea have now begun implementation on Borges. Chris Double has put together an extensive set of links about Continuation based systems.

I’ve always had this nagging feeling that web development was more complex that it needed to be. Continuation based frameworks allow for a more “linear” form of programming. The kind of programming that most folks are used to.

However, I’m extremely curious, how does continuation based frameworks relate to flow based frameworks like the kind found in Weblogic Workshop? Workshop allows pages to be graphically stitched together in a highly in intuitive manner. Although it’s based on different concepts, does it not acheive almost the same thing?

The beauty of the Seaside implementation is that is built on top of an Object Oriented language as opposed to modifying an interpreter as in the case of Cocoon’s flowscript. Could we not implement Seaside in Java? How would this implementation be similar to implementing a “process” engine in Java? It’s all extremely interesting, hopefully I can get some answers in due time.

Share the article!

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>