[Catalyst-dev] Catalyst plugin

Matt S Trout dbix-class at trout.me.uk
Sun Oct 5 11:40:47 BST 2008


On Thu, Oct 02, 2008 at 03:41:23PM +0300, Octavian Rasnita wrote:
> > Given that your goals (as I quoted above from another email in the  
> > thread) are deliberately limited in scope so as to make the module  
> > simple to use, would it not make sense to call it  
> > Catalyst::View::Email::Simple or something? I guess not if you're not  
> > inheriting from Catalyst::View::Email, but I still think the current  
> > name is ambiguous..
> 
> I thought that if the mail message is created with Mail::Builder, the name Catalyst::View::Mail could be a good name for the module.

No no no no no no no.

Having a C::V::Email -and- a C::V::Mail will confuse the shit out of newbies
to no gain. Please, please don't do that.

>From what I can see, C::V::Email is responsible for three things:

1 constructing the mail from the input
2 sending the mail once it's constructed
3 processing config and stash to make the arguments to the first two

So far as I can see, you want to provide an alternative for (1) that uses
Mail::Builder, and an alternative for (3) that provides a simpler interface.

Both of these things would be potentially useful in isolation.

So, the answer seems to me to be to make sure C::V::Email's code separates
all three stages, then you can provide a component that overrides (1) and
one that overrides (3) and then a third module that does

use parent qw(
  Thing::That::Overrides::One
  Thing::That::Overrides::Three
  Catalyst::View::Email
);

and NEXT/C3 will dispatch things appropriately for you.

Of course, the ::One overrider would mostly bolt in your external code, so
it'd then be easy to re-use that outside Catalyst.

-- 
      Matt S Trout       Need help with your Catalyst or DBIx::Class project?
   Technical Director                    http://www.shadowcat.co.uk/catalyst/
 Shadowcat Systems Ltd.  Want a managed development or deployment platform?
http://chainsawblues.vox.com/            http://www.shadowcat.co.uk/servers/



More information about the Catalyst-dev mailing list