Question: IoC is nice but, used with autowiring (@EJB, @Autowired, @Inject, @SpringBean...), don't you think it limit a goal of IoC?

Actually i don't know so much about autowiring systems in different frameworks but it seems that it's mainly based on types.

When you use @EJB on IService then you need to have only one implementation ServiceImpl to make it work.

What if we want many implementations?

It seems some autowiring annotations can have arguments.
For exemple in Stripes you can do:
@SpringBean("xxxService")
Where xxxService is a spring initialized bean.

In such a case, ok you don't do "new XxxServiceImpl()"
But you still put a hardcoded reference to the service implementation you want to use in your bean. It's simply not a class reference but a spring bean reference to the implementation...

What do you think about that?
I like autowiring but just wonder myself....

Answer: 
Yes, there are limitations to autowiring (just one implementation of an autowired interface), so it defeats a part of the IoC flexibility when it comes to injecting the proper implementation.

However, I see autowiring as just being a way to reduce configuration. So when 90% of your dependencies can be autowired, you tend to end up with less configuration overall (and the remaining configuration is significant, because it only contains the important (implementation-specific) bits)
You can try [autowiring by name](http://static.springsource.org/spring/docs/2.5.x/reference/beans.html). Which will solve your problem.

If you have a hard requirement for autowiring by type. Then you can specify like this,

```
<bean id="PersonBean1" class="com.mkyong.common.Person">
        <property name="name" value="mkyong1" />
        <property name="address" value="address 1" />
        <property name="age" value="28" />
    </bean>

    <bean id="PersonBean2" class="com.mkyong.common.Person">
        <property name="name" value="mkyong2" />
        <property name="address" value="address 2" />
        <property name="age" value="28" />
    </bean>

```

and you can specify the bean in your class like,

```
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;

public class Customer 
{
    @Autowired
    @Qualifier("PersonBean1")
    private Person person;
    private int type;
    private String action;
    //getter and setter methods
}

```

Hope this solves your problem.