<HTML><BODY>Hi all,<br><br>I am really sorry for writing to this mailing list, but I checked all user forums and chats and saw that they are very old.<br><br>I would be very thankful if someone gives suggestion for solving the following problem. <br>I have a child and parent class. Child has SimpleFoo, Parent needs Advaced foo. So,<br><br>@Dependent<br>public class SimpleFoo {<br>}<br><br>@Dependent<br>public class AdvancedFoo extends SimpleFoo {<br>}<br><br>@Dependent<br>public class Child {<br><br>&nbsp;&nbsp;&nbsp; private SimpleFoo foo;<br><br>&nbsp;&nbsp;&nbsp; @Inject<br>&nbsp;&nbsp;&nbsp; protected void setFoo(SimpleFoo foo) {<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; this.foo = foo;<br>&nbsp;&nbsp;&nbsp; }<br>}<br><br>@Dependent<br>public class Parent extends Child {<br><br>&nbsp;&nbsp;&nbsp; @Inject<br>&nbsp;&nbsp;&nbsp; @Override<br>&nbsp;&nbsp;&nbsp; protected void setFoo(SimpleFoo foo) { //How to inject here AdvancedFoo?<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; super.setFoo(foo);<br>&nbsp;&nbsp;&nbsp; }<br>}<br><br>How to inject in Parent AdvancedFoo? I know that I can do it via constructor injection <br>but I need method injection. How to do it? Can it be done without using names (like MyBean1)<br> but only using classes (AdvancedFoo)?<br><br>Best regards, Alex<br><br><br><br><br><br>-- <br>Alex Sviridov</BODY></HTML>