Categories
Spring Spring Core

Control Bean Creation Order in Spring

Generally we provide dependencies of a Bean using the <ref/> attribute in Spring Configuration Meta-Data as like below. The “employeeController” bean is directly depending on the “employeeManager” bean. But, all the dependencies of a Bean will not direct like this. Some dependencies will be indirectly referred into the Bean Object. For Example : EmployeeController class […]

Categories
Spring Spring Core

Static Factory Method in Spring

In our previous article we saw how to instantiate a Bean with Constructor in Spring Framework. Now we will look at how we can instantiate a Static Factory Method.  Instantiate a Static Factory Method in Java  In a plain Java application we can instantiate the above Static Factory class as like below from another class […]

Categories
Spring Spring Core

Dependency Injection in Spring

Dependency Injection is a process to change the Binding of Objects from Compile time to Runtime. It focuses on creating loosely coupled objects and to make decoupling easier, Objects define their own dependent Objects and there will not be any tight-coupling between them. IoC container is responsible to create a Dependent objects and Inject where […]

Categories
Spring

Spring IoC Container

What is IoC Container ? Inversion of Control container is nothing but a set of Interfaces and Classes implemented using DI pattern and it is responsible for Instantiating, Assembling and Configuring the Beans that is defined in Configuration Meta-data. org.springframework.beans and org.springframework.context are the base package for Spring IoC container and BeanFactory, ApplicationContext are the […]