You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by Denis Stepanov <de...@gmail.com> on 2011/04/22 13:18:24 UTC

IOC Setter injection

Is there any way to use setter injection in Tapestry IOC? 

I have found this article http://blog.tapestry5.de/index.php/2011/01/17/javax-inject-inject-support-in-tapestry/ which tells that Tapestry supports setter injection by default but i can't find any reference in documentation or source code.

Thanks,
	Denis

Re: IOC Setter injection

Posted by Denis Stepanov <de...@gmail.com>.
I haven't found any code related to setter injection. 

I'm researching if it is possible to convert some old spring beans into using Tapestry IOC without a lot of work. Anonymous setter injection is the only way how to achieve it.

Denis

On 25.4.2011, at 2:24, Igor Drobiazko wrote:

> Actually setter injection is supposed to work when autobuilding services.
> 
> Отправлено с iPhone
> 
> 25.04.2011, в 00:00, "Thiago H. de Paula Figueiredo" <th...@gmail.com> написал(а):
> 
>> On Fri, 22 Apr 2011 08:18:24 -0300, Denis Stepanov <de...@gmail.com> wrote:
>> 
>>> Is there any way to use setter injection in Tapestry IOC?
>> 
>> Yes, but not using autobuilding. Use a builder method instead:
>> 
>> public static YourService buildYourService(DependencyType1 type1, ...) {
>>   YourService service = new ...;
>>   service.setDependencyType1(type1);
>>   return build;
>> }
>> 
>> -- 
>> 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
>> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> For additional commands, e-mail: users-help@tapestry.apache.org
> 


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


Re: IOC Setter injection

Posted by Igor Drobiazko <ig...@gmail.com>.
Actually setter injection is supposed to work when autobuilding  
services.

Отправлено с iPhone

25.04.2011, в 00:00, "Thiago H. de Paula Figueiredo"  
<th...@gmail.com> написал(а):

> On Fri, 22 Apr 2011 08:18:24 -0300, Denis Stepanov <denis.stepanov@gmail.com 
> > wrote:
>
>> Is there any way to use setter injection in Tapestry IOC?
>
> Yes, but not using autobuilding. Use a builder method instead:
>
> public static YourService buildYourService(DependencyType1  
> type1, ...) {
>    YourService service = new ...;
>    service.setDependencyType1(type1);
>    return build;
> }
>
> -- 
> 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
>

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


Re: IOC Setter injection

Posted by "Thiago H. de Paula Figueiredo" <th...@gmail.com>.
On Fri, 22 Apr 2011 08:18:24 -0300, Denis Stepanov  
<de...@gmail.com> wrote:

> Is there any way to use setter injection in Tapestry IOC?

Yes, but not using autobuilding. Use a builder method instead:

public static YourService buildYourService(DependencyType1 type1, ...) {
	YourService service = new ...;
	service.setDependencyType1(type1);
	return build;
}

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