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
David Binger
2005-01-03
On Jan 3, 2005, at 7:29 AM, Toni Alatalo wrote:

> On Mon, 3 Jan 2005, Thomas Guettler wrote:
>
> just a reaction, if this is becoming like a vote..
>
>> 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.
>

In the Quixote 1 pattern, you can conclude that any method that does
not support
1-argument calls is not directly called during traversal.
In the default Quixote 2 pattern, you can conclude that any method that
does not support
0-argument calls is not directly called during traversal.
Neither style provides a signature that provides evidence that the
method actually
can be called via the web.


> was sometimes a bit strange though to have it passed through a longish
> chain of intermediate functions finally to the one that rendered the
> response, but still didn't find that bad.

And especially strange if none of the functions in the chain of calls
actually uses it for anything.  You must either pass it to every
function
regardless of need, or only sometimes pass it and support another way of
doing the same thing, or, as we do here, always use the same function
and don't pass the request around at all.


reply