Am 01.07.2011 um 12:47 schrieb Janko Mivšek:

> S, Julian Fitzell piše:
>> 2011/6/30 Janko Mivšek <[email protected]
>> 
>>    Whole point is that this is a non-blocking code, in contrast to
>>    continuation based approach like in Seaside, where similar code would
>>    block and wait until dialog component returns answer.
>> 
>> Janko, what are you talking about? If it's not blocking, it's just a
>> callback. Of course Seaside can do the same thing: you just use
>> #show:onAnswer:.
> 
> Isn't the whole point of Seaside and continuations to enable worklow
> like in below example from the HPI Seaside tutorial? This code is
> blocking until the call: returns, isn't that so?
> 
> From HPI tutorial [1], chapter 5-Forms, figure 5-2 :
> 
>       (self call: self taskEditor)
>         ifTrue: [aTask copyFrom: self taskEditor task]
> 
> Text bellow: "Even better, Seaside remembers the position in your code
> and runs it from there again, after the called component finished. This
> means, #call: blocks your current component, that is your callback
> evaluation, waits for the called component to be finished, and
> afterwards goes on with your callback. "


Janko, it is just the style of continuity you choose. If you want to do an 
asynchronous thing than you split your method into two parts. The first 
registers the second part as callback anywhere and if the callback is activated 
the second part of your method is executed. That can be very cumbersome if you 
have to split it all up.
With continuations you split the code at the point the continuation is created. 
You return from that method and if the callback (the continuation) is invoked 
you just step into the old method and proceed from there.
The only difference I can see is that the latter is far more elegant and 
powerful.

Norbert

Reply via email to