durusmail: quixote-users: Request subclassing
Request subclassing
2005-11-09
2005-11-09
2005-11-10
2005-11-10
2005-11-10
2005-11-10
Matt Patterson (3 parts)
2005-11-11
Matt Patterson (2 parts)
2005-11-11
2005-11-11
Request subclassing
Matt Patterson
2005-11-10
On 10 Nov 2005, at 11:43, David Binger wrote:

> If people are going to the trouble to subclass HTTPRequest, then I
> don't think
> subclassing Publisher too will present any significant obstacle.
> It seems
> better to me to leave the keyword option out.

I think that's probably better.

> If the Publisher is be the authority request instance construction,
> maybe
> it also be the caller of the request constructor.
>
>     def process(self, stdin, env):
>         request = HTTPRequest(stdin, env)
>         return self.process_request(request)
>
> Wouldn't this simplify the responsibilities of the driver scripts?
> (And you could override process to get your customized requests.)

Yeah, I like that. That seems to be a  nice encapsulation, and it
should still allow the vast majority of users to upgrade without
having to do anything (and the WSGI wrapper patch would be trivial).

Matt

--
   Matt Patterson | Design & Code
    | http://www.emdash.co.uk/
    | http://www.reprocessed.org/

reply