[Catalyst] Modifying Catalyst component load order

Tomas Doran bobtfish at bobtfish.net
Sun Jul 18 16:33:09 GMT 2010


On 16 Jul 2010, at 17:55, Rob Hoelz wrote:
> This way, applications requiring a custom load order can override  
> determine_component_load_order if they which,
> and plugins can override it to provide cool features like dependency  
> resolution.
>
> Thoughts?

This year's GSOC project is to put Bread::Board into Catalyst, giving  
us full dependency resolution (and lots of other nice things), rather  
than relying on what is basically a hack (loading components in a  
specific order)..

However I do feel your pain - in the short term I'd go with the  
solution Eden suggested.

after setup_components => sub {
     my $app = shift;
     for (keys %{ $app->components }) {
       $app->components->{$_}->initialize_after_setup($app) if $app- 
 >components->{$_}->can('initialize_after_setup');
     }
};

Something like that?

Cheers
t0m




More information about the Catalyst mailing list