Bean is nothing but a normal Java class, when it is configured and managed in a IoC container of Spring it becomes a special type of Object called Bean. Generally we can create a class with default no-args constructor or constructor with an argument, Static factory method with constructor as private access modifier or else […]
Naming and Aliasing of Beans
Naming of Beans Objects that are created and managed by a Spring IoC container are called as Beans. The container has to identify each and every bean that we are going to configure and use. To identify those beans we can provide ID and Name in Bean configuration Xml, each bean can have more than […]
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 […]
Introduction to Spring
Spring is an Open-Source framework and it has a wide range of documentation provided to make the learning curve easy. Spring came into existence in 2003 to overcome the heavy weight complexity in J2EE applications. People are thinking of some lightweight methodologies to divide a large application into small pieces and finally wire together. If […]
What is IoC and DI in Java
What is Inversion of Control? As the name suggests, IoC is to Invert the control flow of a program. It is an Idea to Decouple/remove dependencies of the object and provide control to another layer(XML, Java Class, Properties,…) to instantiate required Objects. For more understanding on the above definition I’m adding below example code and […]