Boost logo

Boost :

From: Giovanni Piero Deretta (gpderetta_at_[hidden])
Date: 2006-09-14 11:36:22


On 9/14/06, Jose <jmalv04_at_[hidden]> wrote:
> On 9/14/06, Giovanni Piero Deretta <gpderetta_at_[hidden]> wrote:
> >
> > What do you exactly mean with web continuations? Is it session
> > management done with coroutines instead of encoding state in session
> > ids? I will see if i can come up with something. Ideas are wellcome.
>
>
> The term is used when continuations are used to handle the app flow
> in web forms. It's one of the most popular topics in advanced web
> development !
> Traditional session handling is done via session ids with cookies but it has
> big
> shortcomings when using back button or creating a new browser window plus
> coding
> the app flow is not as natural or elegant as it can be with web
> continuations.
> Web continuations handle the execution state not just the session state.
>
> Some references below. The basic hello example is a calculator app or a
> guessing game.
> The pdf below provides a real world example (a shopping cart)
>
> check section: Web Continuations revolutionizing webapp development
> http://it.sun.com/eventi/jc05/pdf/2-ProNetics.pdf
>
> Crossing borders: Continuations, Web development, and Java programming
> http://www-128.ibm.com/developerworks/java/library/j-cb03216/
>
> Yield, Web Continuations!
> Article shows how to emulate web continuation in .NET framework
> http://www.codeproject.com/useritems/YeildContinuations.asp

After a quick look I see that there could be some problems on
implementing web continuations with coroutines.

The problem is that coroutines are a subset of full continuations. One
shot continuations and subcontinuations can be implemented with
coroutines (and vice versa), but full continuations cannot.

A continuation can be restored multiple times, and this behaviour is
for example used to implement back button handling (the continuation
relative to the previous page state is saved, so it can be restored
when the previous state is reloaded).

I do not see how this could be implemented with coroutines
automatically unless coroutines where deepcopy-able (you could copy a
coroutine and then resome that copy). Unfortuantely it is not feasible
to make deep copies of them in the current language.

As far as i can see, this is the only place where the 'fullness'
aspect of web continuations is used. If you can handle the back button
problem in some other way or simply ignore the problem, then
coroutines are a good way to implement web continuations.

BTW, unless I 'm missing something, the .NET implementation has the
same limitation.

--
Giovanni P. Deretta

Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk