X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=lib%2FCatalyst%2FManual%2FExtendingCatalyst.pod;h=7a65b08edeafdb05c91056850c5836c4e05f5850;hb=be59772bd5bfc24b6518a82ef7d1ff7dd8d2651a;hp=2602cef1fd2ba9ad6f4787695878837fd5b803f6;hpb=b7c570ac9ac40be5f5e22088823e1180717e0141;p=catagits%2FCatalyst-Manual.git diff --git a/lib/Catalyst/Manual/ExtendingCatalyst.pod b/lib/Catalyst/Manual/ExtendingCatalyst.pod index 2602cef..7a65b08 100644 --- a/lib/Catalyst/Manual/ExtendingCatalyst.pod +++ b/lib/Catalyst/Manual/ExtendingCatalyst.pod @@ -46,11 +46,15 @@ forward to L. =item Use the C namespace if you can! -Excluding plugins and of course your C code. B +If your extension isn't a Model, View, Controller, Plugin, or Engine, +it's best to leave it out of the C namespace. Use + instead. =item Don't make it a plugin unless you have to! -A plugin should be careful as it declares in global namespace. +A plugin should be careful since it's overriding Catalyst internals. +If your plugin doesn't really need to muck with the internals, make it a +base Controller or Model. =item There's a community. Use it! @@ -89,6 +93,19 @@ putting it in your C namespace. Just don't put it in C, C or C, because that would make Catalyst try to load them as components. +Writing a generic component that only works with Catalyst is wasteful +of your time. Try writing a plain perl module, and then a small bit +of glue that integrates it with Catalyst. See +L for a +module that takes the approach. The advantage here is that your +"Catalyst" DBIC schema works perfectly outside of Catalyst, making +testing (and command-line scripts) a breeze. The actual Catalyst +Model is just a few lines of glue that makes working with the schema +convenient. + +If you want the thinnest interface possible, take a look at +L. + =head2 Inheritance and overriding methods While Catalyst itself is still based on L (for multiple @@ -126,6 +143,10 @@ module. It also shows that you care for your users. If you would like your module to become a recommended addition, these things will prove invaluable. +If you're just getting started, try using +L to generate some example +tests for your module. + =head2 Maintenance In planning to release a module to the community (Catalyst or CPAN and @@ -589,7 +610,9 @@ L, L, L =head1 AUTHOR -Robert Sedlacek C +Robert Sedlacek C<< >> + +Jonathan Rockway C<< >> =head1 LICENSE AND COPYRIGHT