Spring DI is the most fundamental feature that Spring provides. This feature has also been referred as Inversion of Control but after many discussions it was decided that DI is a better term.
Any application which is of practical use is composed of two or more objects which communicate with, or use, each other. Traditionally each of those objects is responsible to get the reference of objects it uses but in DI objects are given references to the other objects when needed. All the bean creation and their injection are handled by Spring which acts as a container of beans. This provides loose coupling and also promotes programming to an Interface as the bean knows only about the type of bean but nothing about its implementation.
For Example: If the bean Store has declared Product property as an interface then the Product implementation becomes irrelevant. The Product bean can be web-service implementation, an EJB or a mock test object.
Some other benefits of using DI:
• Reduction of boiler plate coding.
• As all metadata is in xml file and is easy to configure. This gives flexibility in testing and development.