Use continuations to develop complex Web applications
Wednesday, December 29, 2004
Jonathan Bartlett mentioned on c.l.s. that IBM has put an article on their developerWorks web site titled "Use continuations to develop complex Web applications - A programming paradigm to simplify MVC for the Web". Although the article focuses on using continuations with the Apache Cocoon web development framework, it does provide a good introduction to continuation-based web application development frameworks in general. The author introduces the topic and summarizes his article nicely:
"Due to the inherent stateless nature of HTTP, Web technologies suffer from the problem of state information being forgotten between two successive user interactions. An interactive Web application consists of a collection of scripts wherein a single interaction comprises one script delivering a page to the browser (then ending), the user completing and submitting the form at some later point in time, and another (possibly different) script handling the submitted form. Thus, application logic is spread across a multitude of scripts.If the article sparks an interest in continuation-based web application development frameworks, you might want to read some of my previous postings (and follow the links in those postings) on the topic (Note: these are listed in reverse-chronological order, so, if you want to preserve the "context" of the postings, read them from the bottom up):
Matters are further complicated by the fact that browsers allow users to backtrack in their interactions or clone an in-progress interaction and run both in parallel. Given this set of possibilities, a user can pursue multiple navigational paths within an application at any given time, and it's up to you to write code to ensure that each outcome is successful. Web development frameworks, such as Spring and Struts, allow you to handle multiple navigational paths, but they do so at the cost of increasing the complexity of an already overly complex code base.
In this article, I'll introduce a continuations-based alternative that can simplify the development of complex Web applications. I'll start with an introduction to continuations, including an argument for how the continuations-based approach can be a shot in the arm for the traditional MVC style of programming. Then I'll move on to a simple example: an enterprise application that demonstrates the advantages of using continuations in terms of ease of development and understanding of the application code. Because one of the chief disadvantages of using continuations is their lack of support on the Java platform, I'll use the Apache Cocoon framework to demonstrate a JavaScript implementation of the example program and a pure Java language one. I'll conclude with an overview of the pros and cons of using continuations."
- 2004-05-21: Implementing call/cc in CL
- 2004-04-04: Modal (Continuation-based) Web Server Framework example
- 2004-02-03: Comparison of two continuation based web server frameworks
- 2003-11-22: Continuation-based Web Framework for CL
- 2003-11-14: Article about Seaside - a continuation-based Web Framework in Smalltalk
- 2003-11-08: Comment about Seaside Web Framework
- 2003-10-13: Some comments on Continuation-based Web Frameworks
- 2003-09-28: Java/Smalltalk Web Framework comparison
- 2003-09-27: Elevator Pitch: Continuations for Web Apps
- 2003-09-25: No good elevator pitch
- 2003-09-08: More Continuation stuff
- 2003-09-04: Chris Double's Scheme Web Framework
- 2003-09-02: Web Interactions paper
- 2003-09-01: Continuations and CL Cookbook mods
- 2003-08-31: Continuation State Issues
- 2003-08-28: Continuation-based web servers

