On 10/5/05, Dave Howorth <[EMAIL PROTECTED]> wrote:
> David Baird wrote:
> > Yes! Much better, better name too, are you going to commit it?
>
> OK, I'll see if I can figure out how to do that :)
>
> > BTW, have we agreed that $r should be $self?
>
> My prejudice is that we should use $self where we're referring to the
> 'controller' (i.e. generally when we're invoking a method) and $r when
> we're referring to the 'request' (i.e. the data attributes - headers,
> params, template vars etc etc). Simon Flack posted a controller vs
> request breakdown once upon a time.
I thought about that, but I think it'll confuse things. It kind of
works for 'pure' controller or request methods, but I think leads to
confusion if a controller method method needs to access data members
on the request.
Um, we could add a stub maypole_request method:
sub maypole_request { @_ }
sub a_controller_method
{
my ($self) = @_;
my $r = $self->maypole_request;
my $path = $r->path;
# etc
}
but that's probably not desirable.
If we want to refer to the thing as a request sometimes, and as a
controller other times, that's a further hint that at some point we
should properly separate them. But ATM, I'd prefer to use the same
label for the invocant everywhere (at least, everywhere within a given
package). It probably makes sense to call it $r in most plugins, and
it certainly makes sense to call it 'request' inside templates. I vote
for $self within Maypole.pm because it has heavier emphasis on
controller aspects, and because I think we probably will want to
separate the controller and the request One Day.
d.
-------------------------------------------------------
This SF.Net email is sponsored by:
Power Architecture Resource Center: Free content, downloads, discussions,
and more. http://solutions.newsforge.com/ibmarch.tmpl
_______________________________________________
Maypole-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/maypole-devel