Re: Injection related experiences

2014-04-05 Thread Thiago H de Paula Figueiredo
On Sat, 05 Apr 2014 18:51:44 -0300, Sanket Sharma wrote: Okay, so following your advice, I gave it another try. Created a new project using tapestry jumpstart and experimented with case 1 type injection again. And guess what...it works! Yay! :) As I analysed the code again, I am wonder

Re: Injection related experiences

2014-04-05 Thread Sanket Sharma
Okay, so following your advice, I gave it another try. Created a new project using tapestry jumpstart and experimented with case 1 type injection again. And guess what...it works! I was able to test all three types and it worked without any issues! Great, so then I moved back to my code and tried

Re: Injection related experiences

2014-04-05 Thread Thiago H de Paula Figueiredo
On Sat, 05 Apr 2014 16:35:21 -0300, Jon Williams wrote: one other thing occurs to me. you should also make sure you are using the Tapestry @Inject annotation and NOT the javax.inject one. Actually, since 5.3, Tapestry-IoC supports javax.inject.Inject: https://tapestry.apache.org/using-jsr

Re: Injection related experiences

2014-04-05 Thread Thiago H de Paula Figueiredo
On Sat, 05 Apr 2014 15:46:26 -0300, Sanket Sharma wrote: Sorry, I wrote that email in a rush - should have been more explicit. Let me try and explain with code: public class MyServiceImpl implements MyService { @Inject//This is not supported for services,

Re: Injection related experiences

2014-04-05 Thread Jon Williams
one other thing occurs to me. you should also make sure you are using the Tapestry @Inject annotation and NOT the javax.inject one. On Sat, Apr 5, 2014 at 1:26 PM, Jon Williams wrote: > your findings are a bit odd. > > case 1) should work. > eg. > " > public class UserServiceImpl implements Use

Re: Injection related experiences

2014-04-05 Thread Jon Williams
your findings are a bit odd. case 1) should work. eg. " public class UserServiceImpl implements UserService { @Inject private DomainObjectService domainObjectService; " case 2) i never use case 2) because it's handled by your case 1). case 3) Constructor injection is also viable as you

Re: Injection related experiences

2014-04-05 Thread Sanket Sharma
Sorry, I wrote that email in a rush - should have been more explicit. Let me try and explain with code: public class MyServiceImpl implements MyService { @Inject//This is not supported for services, will not work ServiceB serviceB; @InjectService(

Re: Injection related experiences

2014-04-05 Thread Thiago H de Paula Figueiredo
On Fri, 04 Apr 2014 18:25:41 -0300, Sanket Sharma wrote: Hi, Hi! First, You cannot inject dependencies into fields of a service class. Now this is mentioned in the documentation very clearly, it took me some time to get my head around it. No matter what you do or customise or override, yo

Injection related experiences

2014-04-04 Thread Sanket Sharma
Hi, I am busy developing an application in Tapestry and it has mostly been a good experience so far. I struggled with dependency injection for last few days, but I think I finally got it right. However, while trying to get it to work, I made the following observations: First, You cannot inject