My latest assignment, a terminal based, C++ application, is a pleasant change from the web based, Java applications that I had been working on for the last year. Even with Java’s advantages over C++, I suspect it would take longer to build a web version of this application than a terminal version.
A typical web application consists of a bunch of little programs, all doing this:
Early on, the Java people standardised the interface to these little programs and called them servlets.
In constrast, a terminal application has a bunch of subroutines that all look like this:
Not nearly as complex. And because the code is not stopping and starting with each interaction, there are no session state bugs, fewer security issues, and it really is about half the code.
Aaron Watters puts it succinctly:
Unrolling the application at each point where you need to wait simply turns the code inside out…
Of course, the reason why we write our applications inside-out is that it scales much better than if we don’t. What if there was a way to build scalable applications “inside-in and outside-out”? Jeremy Hylton points to a number of papers and projects addressing this problem.
Comments
@see http://cocoon.apache.org/
The latest version supports serverside continuations and works exactly like a programmer would expect.
The nice thing is that it also has pipeline model that makes it easy to declare what to do with the xml, and that is easily accessed by the flowscript.
Another project with continuations is RIFE
https://rife.dev.java.net/
I've been using it and found it highly intuitive.
HTH!