Matt Goodall ha scritto:
[...]
True, but even passing a request or env dict around to everyone gets
tedious don't you think?

Yes, it can be tedious but I believe explicit arg passing is necessary
to make code readable, testable and reusable.

If it's web-related code then give it the request, it will almost
certainly need it. Otherwise, don't.

I would even advocate extracting request-scope objects, e.g. a database
connection, the current user, etc, as early as possible and passing them
around explicitly (along with the request, if necessary).


This exactly what I too have realized!

I'm developing a WSGI framework with all these (and other) ideas:
http://hg.mperillo.ath.cx/wsgix

Its still not documented, so I have not yet made an official announcement.

The main design goal is to keep the level of the interface as low level as possible.

I don't like additional interfaces (like Request and Response) objects around the WSGI dictionary, and I don't like frameworks like Django that completely hides the WSGI interface.


> [...]



Manlio Perillo
_______________________________________________
Web-SIG mailing list
Web-SIG@python.org
Web SIG: http://www.python.org/sigs/web-sig
Unsubscribe: 
http://mail.python.org/mailman/options/web-sig/archive%40mail-archive.com

Reply via email to