On 9/1/05, Rhesa Rozendaal <suppressed> wrote:
> Will the protected_runmodes() method be additive? Mine is, and it's
> probably evident that it should be. What I mean is that if you call it
> several times, the new ones are added to the store, they don't replace
> the ones from the previous call. Just like runmodes() operates too.
Yes, this will be necesary. You may configure the plugin in a super
class, but you may call protected_runmodes from a subclass as well.
> I also notice you make mention of an Auth attribute on the run mode
> subs. Wouldn't that eliminate the need for the protected_runmodes()
> method? In any case, I'd think the docs should make it clear that you
> can use either one of both ways, not that you have to both set the
> attribute _and_ call protected_runmodes() at the same time. Right?
Ya, it is an either or. I like using attributes because it keeps the
relevant information close to the function. However, using a common
prefix might be a good idea as well. What I do personally is module
wide authentication. So either all runmodes in a module require
authentication, or none of them do.
An easy way to handle that would be to create a base class without
authentication, then create a second base class that is a subclass
that configures the authentication and sets
__PACKAGE__->protected_runmodes(':all'). This means that any module
that inherits from your Auth base class will automatically require
authentication for all of its runmodes.
Maybe that means we require another setting besides :all. Something
that defines 'all runmodes in this module, but not its subclasses'.
That might be tricky though, since when you call a runmode you don't
necesarily know where in the inheritance tree that method appears.
Food for thought...
> I'm running out of time to comment more. Looks good so far, and really
> usable for newcomers and old-hats alike.
Thanks for the feedback!
Cheers,
Cees
---------------------------------------------------------------------
Web Archive: http://www.mail-archive.com/suppressed/
http://marc.theaimsgroup.com/?l=cgiapp&r=1&w=2
To unsubscribe, e-mail: suppressed
For additional commands, e-mail: suppressed
Mail converted by mhonarc 2.6.15
This archive provided courtesy of JSW4.NET, Internet Hosting Services for Small Business.