How does dependency injection work in Spring?

Tags: , ,



I want to know how spring does dependency injection. I want the low level logic used.

Updates:

I want to know how the object references are injected to the constructors or setter methods, is it through Reflection or some byte code level.

Answer

Configuration of dependencies are read from XML, annotations or Java DSL (JavaConfig). Then Spring DI engine wires the dependencies based on the metadata from the configuration using the Java reflection API.



Source: stackoverflow