This content has been marked as final.
Show 3 replies
-
1. Re: java-new()-Operator and @Inject @New
mausbull.stephan.pabinger.gmail.com Feb 9, 2011 10:11 AM (in response to nimo22)Hi,
as 'u' is a private member of MyView, it stays alive as long as MyView is alive.
I would say the usage of 'new()' and '@Inject @New' depends on the specific cases.Stephan
-
2. Re: java-new()-Operator and @Inject @New
nimo22 Feb 9, 2011 10:29 AM (in response to nimo22)
I would say the usage of 'new()' and '@Inject @New' depends on the specific cases.And, for example, what for case?
In my scenario, @Inject @New is the same as java-new().
-
3. Re: java-new()-Operator and @Inject @New
amitev Feb 11, 2011 7:04 PM (in response to nimo22)You should avoid constructing CDI beans yourself. The whole point of dependency injection is to get the container controlling the lifecycle of your dependencies.