On Tue, 31 Jan 2012 14:24:11 -0200, Julien Martin <bal...@gmail.com> wrote:

Hello all,

Hi!

I am trying to better understand how T5 components work and I would like to know what the difference is between @Environmental and @Inject and when to use which in the context of component developpement of course.

They're very, very, very different.

@Inject is one way to get services from the Tapestry-IoC registry. @Environmental uses the Environment service, which is used for components or pages to pass some information for components inside them.

For instance having a look under the hood of t:checklist, I noticed that
the validation tracker is injected by the @Environmental annotation as
follows:

*@Environmental*
*private ValidationTracker tracker;*

ValidationTracker is not a service.

whereas the javascript support variable is injected by the @Inject
annotation as follows:

*@Inject*
*private JavaScriptSupport javaScriptSupport;*

JavaScriptSupport is a service.

--
Thiago H. de Paula Figueiredo
Independent Java, Apache Tapestry 5 and Hibernate consultant, developer, and instructor
Owner, Ars Machina Tecnologia da Informação Ltda.
http://www.arsmachina.com.br

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

Reply via email to