[Web-SIG] Request and Response objects
Gregory (Grisha) Trubetskoy
grisha at modpython.org
Wed Oct 29 20:14:31 EST 2003
Let me argue the single request point with some specifics.
IMO dual objects create a semantics mess, here is a couple of examples:
o The point that I already brought up that reading from one object and
writing to another is unintuitive and misleading.
o Where does the connection information such as remote host, the raw
socket, etc information belong, request or response?
o Mod_python (or httpd rather) allows for cleanups to be registered, to
run after the request is finished being processed. Again - where would a
clean up fit in, at the end of a _request_ or at the end of a _response_?
(and when _does_ a request really end?)
o What about server information (document root, etc)?
o If there exists such a thing as a subrequest or internal redirect, then
in httpd's single object framework you can access the previous and next
request objects via req.prev or req.next. With two objects, it would be
something like response.subreq and response.subreq.resp, and to dig one
level deeper (req.next.next in single object model), it would be
Or if I am within a subrequest, how can I get at the parent (req.prev)?
- you see my point, I hope.
6. When processing is aborted, which could happen while the request is
being read or while the response is being written - the logic should not
be duplicated in two different objects.
These are a few problems that I can think of with the dual object model,
yet so far I haven't seen anything seriously convincing in advocacy of the
dual object model :-)
More information about the Web-SIG