What is the difference between this:
@Inject
public GuitarPlayer(Provider<Instrument> ins) {
instruments = new LinkedList<Instrument>();
for (int i = 0; i < 5; i++) {
instruments.add(ins.get());
}
}
and this:
@Autowired
public GuitarPlayer(List<Instrument> ins) {
instruments = new LinkedList<Instrument>();
for (int i = 0; i < 5; i++) {
instruments.add(ins.get(i);
}
}
I assume that in the first example every position in the list will be a separate instance. If so is it possible to inject in my xml configuration file multiple classes which implement the same interface?