[ 
https://issues.apache.org/jira/browse/TAP5-795?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Peter Stavrinides updated TAP5-795:
-----------------------------------

    Component/s:     (was: documentation)
                 tapestry-ioc
    Description: 
It is mentioned in the documentation that the order in which services are 
created is not defined when using eagerLoad().

You can get into serious trouble If ordering of eagerloaded services is 
important (and it often is) using this :
binder.bind(ImageService.class).eagerLoad();

It can produce a NPE or work just fine and go undetected, but is a ticking time 
bomb. Perhaps this method should be renamed to eagerLoadUnordered() or removed 
entirely, and a way of ordering these would be great to have.



  was:
It is mentioned in the documentation that the order in which services are 
created is not defined when using eagerLoad(), but it is not mentioned that 
StartupInitializer can define an OderedConfiguration for EagerLoaded services, 
which is important to know.

You can get into serious trouble If ordering of eagerloaded services is 
important (and it often is) using this :
binder.bind(ImageService.class).eagerLoad();

It can produce a NPE or work just fine and go undetected, but is a ticking time 
bomb. Perhaps this method should be renamed to eagerLoadUnordered() or removed 
entirely.




> StartupInitializer provides an OderedConfiguration for EagerLoaded services
> ---------------------------------------------------------------------------
>
>                 Key: TAP5-795
>                 URL: https://issues.apache.org/jira/browse/TAP5-795
>             Project: Tapestry 5
>          Issue Type: Improvement
>          Components: tapestry-ioc
>    Affects Versions: 5.1
>            Reporter: Peter Stavrinides
>
> It is mentioned in the documentation that the order in which services are 
> created is not defined when using eagerLoad().
> You can get into serious trouble If ordering of eagerloaded services is 
> important (and it often is) using this :
> binder.bind(ImageService.class).eagerLoad();
> It can produce a NPE or work just fine and go undetected, but is a ticking 
> time bomb. Perhaps this method should be renamed to eagerLoadUnordered() or 
> removed entirely, and a way of ordering these would be great to have.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.

Reply via email to