-
1. Re: Session beans (annotated with @Name): @In or @EJB
msystems Feb 3, 2008 1:52 PM (in response to msystems)
I know the EJB container takes care of the injection when I'm using @EJB to inject a session bean (i.e. a seam component is not created).
i.e. a seam component is not creatednot true - SessionBeanInterceptor creates a Seam component if session bean was obtained by @EJB.
But I still asking myself 'what is the advantage of using @In instead of @EJB?'
-
2. Re: Session beans (annotated with @Name): @In or @EJB
sebastiendeg.sebastien.degardin.gmail.com Feb 3, 2008 2:57 PM (in response to msystems)Hi Kenneth,
Here is what Seam Reference guide says :
In all dependency injection implementations that
we have seen, injection occurs when the component is constructed, and the reference does not subsequently
change for the lifetime of the component instance. For stateless components, this is reasonable. From the point
of view of a client, all instances of a particular stateless component are interchangeable. On the other hand,
Seam emphasizes the use of stateful components. So traditional dependency injection is no longer a very useful
construct (more on chapter 3.3 of the Seam Reference guide.)Also, @In provide any kind of Seam component, EJB, JavaBean, EntityManager, .... not only @EJB