Thiago H. de Paula Figueiredo schrieb:
Em Mon, 20 Apr 2009 16:38:51 -0300, manuel aldana <ald...@gmx.de> escreveu:

When does tapestry-ioc inject stuff to object (@Inject annotation)? I guess it is straight after finishing the constructor...

Is it possible to have the injection already available after the call of super() inside the constructor? This way the injection would be available already inside the rest of the constructor code.

Wouldn't it be easier to just use constructor injection? I use @Inject just in Tapestry pages, components and mixins, never in services. In them, always constructor injection. It makes it way easier to test them without Tapestry-IoC.
Your convention makes sense, but what do you do with objects which are usually created directly by other code and not by tapestry, thus constructor injection won't be the best solution? An example could be for instance domain-model objects, which use services internally. You create them by for instance passing mandatory fields into the constructor.

If applicable I try to inject services to domain-objects to add pluggable behaviour to them (so I don't end up with an anemic domain model).

So I am right that tapestry-ioc exclusively is injecting fields after having passed the constructor code?

--
manuel aldana
ald...@gmx.de
software-engineering blog: http://www.aldana-online.de


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

Reply via email to