On Thu, 14 Jun 2012 15:41:59 -0300, Muhammad Gelbana <m.gelb...@gmail.com> wrote:

I'm injecting the service in the module class just to be able to call it in the registry-contribution method to test the service once the applications starts up.

Do you know you can use injection (no annotations needed) in build, contribute and advise methods in Tapestry-IoC module classes? ;)

But actually in production i'm doing the same, to call some of
my services methods to initialize them in a way, but since it looks weird
how do you guys think I should initialize a service ?

What about its constructor? This will work only if this initialization doesn't use other services.

is the eagerLoad() method while binding the only way ?

Another option is to contribute to the RegistryStartup configuration a Runnable that invokes your service. Just calling it directly in contributeRegistryStartup() makes the call to happen before the registry was actually started up.

Makes me think, when I was first learning about tapestry I had many things done in the wrong way or even not-so-right way and the application
continued to grow based on these wrong concepts.

I call that learning. :)

--
Thiago H. de Paula Figueiredo

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
For additional commands, e-mail: users-h...@tapestry.apache.org

Reply via email to