DI exists in two major variants, Constructor-based dependency injection and Setter-based dependency injection.
My understanding is that interface injection is actually implemented through setter injection:
interface InjectPerson {
public void injectHere(Person p);
}
class Company implements InjectPerson {
Person injectedPerson;
public void injectHere(Person p) {
this.injectedPerson = p;
}
}
Spring’s documentation says:
My understanding is that interface injection is actually implemented through setter injection: