durusmail: quixote-users: why pass request object to public functions / methods
why pass request object to public functions / methods
why pass request object to public functions / methods
2005-01-03
2005-01-03
2005-01-03
2005-01-03
2005-01-03
2005-01-03
2005-01-03
2005-01-03
2005-01-03
2005-01-03
2005-01-05
2005-01-03
2005-01-03
why pass request object to public functions / methods
Thomas Guettler
2005-01-03
Am Samstag, 1. Januar 2005 01:05 schrieb Zachery Corbiere:
> Having the request be part of the signature makes it easier to test
> your code in isolation by passing in fake requests rather than faking
> out get_request() and its friends.  Also, it's been my experience that
> magic global state, even hidden behind function calls, ends up causing
> grief eventually.

Hi,

I like the request in the signature of a method, too. You see immediately
if a method is called via web or if it is a internal method which can't be
called from a webbrowser.

 Thomas

reply