Re: Issues of state (was: Tkinter or wxpython?)



In article <7x8x8mpn37.fsf@xxxxxxxxxxxxxxxxxxx>,
Paul Rubin <http://phr.cx@xxxxxxxxxxxxxx> wrote:
.
.
.
I'm not sure what you're getting at in this context. You can write a
desktop app where the window system communicates with a gui toolkit
through a socket (at least that's how X windows works), or you can
write a web app where a browser communicates with an http listener
through a socket. What's the difference, as far as application state
is concerned?

I haven't used wxpython but for tkinter you'd typically have a gui
event loop in its own thread, communicating with the application
through queues. Similarly you can use BaseHTTPServer to collect
browser hits and get the data out of them with the cgi module
functions before passing them to the app. If you want to handle
multiple concurrent users you get into the usual issues of web
servers, but if you're just doing a single user web implementation as
an alternative to a desktop gui, some rudimentary locking is probably
enough to stop accidental simultaneous connections.

If the application is simple enough, you can just write it as a cgi
and keep the state in disk files.

Others have answered this at other levels. In elementary terms,
there truly is a difference, Paul, and one that's widely reified:
a "desktop client-server" application typically listens through
one socket, which therefore constitutes an index of the connection
or client, while a Web application communicates through a sequence
of independent HTTP transactions. The latter can manage state only
to the extent it passes session information around.

As you correctly point out, there certainly are plenty of Web appli-
cations which cheerfully *do* pass session information. As common
as it is, though--and I'm *still* writing CGI on occasion, a decade
after I was convinced it was a dead technique--it's not automatic.
HTTP is a stateless protocol, and therefore state management must
remain an issue.
.



Relevant Pages

  • Multiple threads in a GUI app (wxPython), communication between worker thread and app?
    ... This is a network app, written in wxPython and the socket module. ... GUI app starts. ... socket should be redirected to the newly opened GUI window. ...
    (comp.lang.python)
  • Re: How best for dll to "report progress"?
    ... The dll can then "communicate" to the external app(in whose process it is ... Call cDll.GatherInfo (oApp.Document)'dll communicates with app ??? ... You have another pure VB EXE ...
    (microsoft.public.vb.general.discussion)
  • Re: ZModem Protocol source code + VC++
    ... I am developing a VC++ GUI based application which communicates ... I need to transfer files from my application ... IIRC, the guy that ran it's name was Wynn Wagner, I saw him in a ...
    (comp.programming)
  • Re: ZModem Protocol source code + VC++
    ... I am developing a VC++ GUI based application which communicates ... I need to transfer files from my application ... Joyeux Noel, Bonne Annee. ...
    (comp.programming)
  • Re: Middle Tire in PHP MySQL
    ... > for a PHP MySQL web app but couldn't make a head way. ... Application server. ... connections can be handled by one Server process. ... XML output that then communicates with an application server running a JAVA app ...
    (comp.lang.php)