[Catalyst] plugins; was Re: debug mode

Dave Rolsky autarch at urth.org
Thu Jun 7 22:43:08 GMT 2007

On Thu, 7 Jun 2007, Matt S Trout wrote:

> I'm not fond of any magic global if I can possibly avoid it - I find it
> tends to encourage tight coupling of code and action at a distance and
> makes testing and debugging messy.

I agree. A singleton is basically a _very_ thin mask for a global.

> I prefer anything a method call needs to have been either (a) passed to the
> object when it was constructed or (b) passed to the method as it's called.

Basically, what Catalyst seems to have is a sort of listener type of 
pattern, but listening is implicit rather than explicit. It's a little 
weird and magical, but I think it's better than a singleton. I'm not sure 
it's the _best_ solution, as it still seems a little too arcane for my 

Also, the docs for this feature could be clearer. I've never quite grokked 
what makes Catalyst decide to look for this method in a class. Is it 
simply _any_ class that's passed in the import list to "use Catalyst"?

The docs refer to "a Catalyst component", but this isn't really 
well-defined. I know it includes models, views, and controllers, but are 
plugins also components?

Also, I know weaken() came up in this discussion. It'd be good if the docs 
addressed exactly when this is needed and give an example.


VegGuide.Org                        www.BookIRead.com
Your guide to all that's veg.       My book blog

More information about the Catalyst mailing list