This content has been marked as final.
Show 4 replies
-
1. Re: Problem with injection
gavin.king May 31, 2007 12:19 PM (in response to thierry.rietsch)Are you asking how to combine polymorphism with injection via @In? Or something else?
-
2. Re: Problem with injection
thierry.rietsch May 31, 2007 12:53 PM (in response to thierry.rietsch)Hi
Sorry for the confusing question.
My questsions are:
- Is this correct, that the field annotated with @In needs to have the same name as the entity is annoted with @Name?
- And yes how is polymorphism done over @In
Sorry again and thanks for your answer!
Thierry -
3. Re: Problem with injection
gavin.king May 31, 2007 1:13 PM (in response to thierry.rietsch)@In can inject any context variable.
You can bind any object to any context variable using @Out or Context.set().
So no, the three components do not have to have the same name. -
4. Re: Problem with injection
gavin.king May 31, 2007 1:14 PM (in response to thierry.rietsch)Or you can turn the implementation inside out and use a @Factory method, which decides what object to return.