[Catalyst-dev] Plugin or controller?

Matthias Dietrich mdietrich at cpan.org
Mon Jun 1 16:46:20 GMT 2009


Hi,

> I'm not sure why $self->flood_control is more confusing than $c- 
> >flood_control.

I meant the module's name.

> A controller should determine, via configuration, how it can be  
> flooded.  If your application needs such things, I would say that  
> something upstream from Catalyst itself is a better solution (but  
> applying this at a root chain would accomplish the same thing).
>
> If it is a plugin, you couldn't allow different rates on a per- 
> controller basis unless you start giving it per-controller  
> configuration... at which point there is a bad design when a plugin  
> starts being controller specific.  Exempting a controller from rate  
> limiting would also be difficult from a plugin perspective.  From a  
> model perspective, the same holds true...

Why couldn't that allow different rates on a per-controller basis?   
Because you define a name for the rates it can be anything.  Even, as  
far as I understand the module Algorithm::FloodControl, the actual  
value for the rate would then be available from within any controller  
without using this controller as a base controller wherever I want to  
access the rate limit.  A rate limiting is not always bound to only  
one controller; it depends on how you use the module.

> There isn't anything in this code that should affect core  
> dispatching or the framework itself, which is what plugins are for

Hm, I don't see why Plugin::Authorization falls under this but not  
Controller::RateLimit.

matt

-- 
rainboxx Matthias Dietrich
Freier Software Engineer

rainboxx                  |  Tel.: +49 (0) 151 / 50 60 78 64
Tölzer Str. 19            |  Mail: matt at rainboxx.de
70372 Stuttgart           |  WWW : http://www.rainboxx.de

XING: https://www.xing.com/profile/Matthias_Dietrich18
GULP: http://www.gulp.de/profil/rainboxx.html



-------------- next part --------------
A non-text attachment was scrubbed...
Name: PGP.sig
Type: application/pgp-signature
Size: 194 bytes
Desc: Signierter Teil der Nachricht
Url : http://lists.scsys.co.uk/pipermail/catalyst-dev/attachments/20090601/2f2ff526/PGP.pgp


More information about the Catalyst-dev mailing list