You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by Julien Martin <ba...@gmail.com> on 2012/01/31 17:24:11 UTC

Question regarding the internals of t:checklist component..

Hello all,

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.

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;*

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

*@Inject*
*private JavaScriptSupport javaScriptSupport;*
*
*
Any reason why that is?

Regards,

Julien.

Re: Question regarding the internals of t:checklist component..

Posted by "Thiago H. de Paula Figueiredo" <th...@gmail.com>.
On Tue, 31 Jan 2012 14:24:11 -0200, Julien Martin <ba...@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-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org