Dependency injection ,they core function of the spring,as is well known, spring is the main JEE development stack, the following are the understanding of the DJ:
in the traditional programming ,there are usually two roles: caller and callee . when one instance need assistance of another instance, caller creates instance of callee directly.
but in spring ,caller can not immediately instantiate callee , the spring container is in charge of the instance of the callee, and then injects to the caller . that is the dependency injection.
the principle are following:
1 higher lever modules should not depend upon the lower lever modules , they should depend on abstraction level.
2 abstraction should not depend upon details ,the details should depends on abstraction