Spring Dependency Injection – Constructor Injection

Through my earlier posts we have learnt about Spring Setter Injection and all its types, in setter injection we will be having the POJO’s for all the property which is present in the class, whereas in Constructor Injection we will have the parameterized constructors which will be setting values to the properties. We will be using <constructor-arg> tag to achieve it. [Read more…]

Spring Dependency Injection – Setter Injection

Dependency Injection is the most important concept of the Spring. It is also called as Inversion of Control (IoC). Dependency Injection makes our code Loosely Coupled, Spring’s IOC container is light-weight and it manages the dependency between objects using configurations. It connects the related objects together, instantiates and supplies them based on configuration. Spring DI can be configured in two different way XML Based (Spring-configuration xml) and Annotation based. [Read more…]