Storing data across webserver calls
Parker Jones <[email protected]> Wed, 28 May 2014 22:34:37 +1200
| Newsgroups | gmane.comp.ai.prolog.swi |
|---|---|
| Message-ID | <[email protected]> |
[Hope this list address still works, I haven't got around to moving across to google yet]
Dear All,
I am converting a text-based Prolog application to have a GUI via a webserver. In the code I have a predicate where data is threaded through the body.
p(DataOut) :-
q1(Data1), % q1(-Data)
q2(Data1, Data2), % q2(+Data, -Data)
q3(Data2, DataOut). % q3(+Data, -Data)
As part of the conversion to a UI application p/1 will be replaced by button presses for each of q1, q2, and q3 and a handler for each button press.
% for webserver
handler(q1_button, q1).
handler(q2_button, q2).
handler(q3_button, q3).
The question then arises, how should data be threaded across handlers q1, q2 and q3.
Option 1: use the clause database, asserting and retracting intermediate data. Each handler retrieves data, performs a calculation and then stores the data again.
Option 2: use http session data. This moves the intermediate data back and forth to the client. Not so good if the data is substantial.
My question is are these the only options or are there any other ways to thread data across web handlers?
Many thanks for any suggestions,
Parker
-------------- next part --------------
HTML attachment scrubbed and removed