[Seaside] How to [ ] ensure: [ ] and call:

Michel Bany m.bany at wanadoo.fr
Fri Jun 17 08:50:57 CEST 2005


We are using Seaside to build the UI of a back-end service.
While processing requests to the back-end service, the UI is notified of 
progress
using Notifications. Also, we need to close the connection with the 
back-end service
as soon as the transaction is finished. Something like this

    backEndService connect.
    [

           [... issue requests to the back-end service ...]

           on: Notification
            do:
                 [ :n |
                 ....  handle the notification ...
                 n pass]

    ] ensure: [ backEndService disconnect ].

This works nicely until, we need to send a #call: message in the 
notification handler
to request some additional data or some decision from the end-user.
In this specific instance we are asking the user if she wants to 
continue/abort the process
when it exceeds a certain duration threshold.

In VW, for some reason, the #call: triggers the execution of the 
#ensure: block which is
not our intention. To make it work we had to rewrite the code to use a 
lower level api
in a very circumvoluted "write-only" way.

Would the same happen in Squeak ?
Is there any trick for avoiding this ?

Many thanks for any advice,
Michel.
         
   




More information about the Seaside mailing list