[Catalyst-dev] Re: Plugin or controller?

Aristotle Pagaltzis pagaltzis at gmx.de
Tue Jun 2 10:31:11 GMT 2009


* Matthias Dietrich <mdietrich at cpan.org> [2009-06-01 19:15]:
> But as I  understand it, not every plugin module on CPAN should
> be a plugin?  But when this is based on opinions, who decides
> which is a plugin and which not?

It’s *NOT* based on opinions.

There are objective technical reasons for whether something
should be a plugin or not.

The benefit of making something a plugin is access to some Cat
internals and to parts of the dispatch process that other
mechanisms for adding features do not offer.

The drawback is that it’s easy for plugins to conflict because
they all become part of the same global namespace.

Most features do not require such access to internals. There is
no point in incurring the problems caused by plugins if there is
nothing to gain from implementing something as a plugin.

If something needs the access to Cat internals that plugins get,
then and ONLY then it should be a plugin.

Most people who put Catalyst extensions on CPAN made them plugins
anyway in the past, because most people, including at the time
the authors of the Cat documentation, didn’t really know better.

Some of this had to be learned by painful experience.

The documentation has since been fixed.

Much of the newer stuff on CPAN is not being written as a plugin.

That’s all as it should be.

Regards,
-- 
Aristotle Pagaltzis // <http://plasmasturm.org/>



More information about the Catalyst-dev mailing list