Re: [Catalyst] Modifying Catalyst component load order

2010-07-18 Thread Tomas Doran


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


___
List: Catalyst@lists.scsys.co.uk
Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst
Searchable archive: http://www.mail-archive.com/catalyst@lists.scsys.co.uk/
Dev site: http://dev.catalyst.perl.org/


Re: [Catalyst] Modifying Catalyst component load order

2010-07-17 Thread Eden Cardim
 Rob == Rob Hoelz rho...@inoc.com writes:
Rob This way, applications requiring a custom load order can
Rob override determine_component_load_order if they which, and
Rob plugins can override it to provide cool features like
Rob dependency resolution.

Rob Thoughts?

Load order makes the framework be less flexible IMO. Why don't you just
defer the execution of the initialization code until after
setup_components?

___
List: Catalyst@lists.scsys.co.uk
Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst
Searchable archive: http://www.mail-archive.com/catalyst@lists.scsys.co.uk/
Dev site: http://dev.catalyst.perl.org/