1600 PMP mock questions 1400 CAPM mock questions 800 SCJP 6 mock questions 600 OCAJP 7 mock questions 590 OCPJP 7 mock questions 556 SCWCD 5 mock questions 500 OCEJWCD 6 mock questions pdfDownload (java,struts, hibernet etc)

Spring interview questions

!!! Spring interview questions !!!

Explain Dependency Injection with code Example ?



The basic principle behind Dependency Injection (DI) is that objects define their dependencies . Then, it is the job of the container to actually inject those dependencies when it creates the bean.
The basic concept of the Inversion of Control pattern (also known as Dependency Injection (DI) ) is that you do not create your objects but describe how they should be created. You don't directly connect your components and services together in code but describe which services are needed by which components in a configuration file. A container (in the case of the Spring framework, the IOC container) is then responsible for hooking it all up. In a typical IOC scenario, the container creates all the objects, wires them together by setting the necessary properties, and determines when methods will be invoked.

The two major flavors of Dependency Injection are Setter Injection (injection via JavaBean setters) and Constructor Injection (injection via constructor arguments).

Get the code with example http://www.techfaq360.com/tutorial/spring/dependencyinjection.jsp

The information you are posting should be related to java and ORACLE technology. Not political.