Home Tutorial Spring Spring3 Ioc Spring IoC, Spring 3 IoC Container Tutorial and example code.

 
 

Spring IoC, Spring 3 IoC Container Tutorial and example code.
Posted on: July 31, 2010 at 12:00 AM
Advertisement
In this section we are exploring IOC container of the Spring 3 framework.

Spring IoC

In this section we will learn Spring IoC with the help of many articles and ready to test example code. In this section we are exploring IOC container of the Spring 3 framework. The IOC container is the main component of the Spring framework. It provides the main IoC container and AOP framework. The core container of the Spring Framework provides important functionality including dependency injection and bean lifecycle management.

The core container is responsible for providing  essential functionality to the Spring framework. The BeanFactory is the primary component of the core container. The BeanFactory is an implementation of the Factory pattern. The core container of the Spring Framework provides Dependency Injection and Inversion of Control (IOC) functionalities.

Modules of Core Container:

Following are the modules of the Spring Core Container:

  1. Beans
  2. Core
  3. Context
  4. Expression Language

IoC

The IoC or Inversion of Control is the core features of the Spring Framework. Developers uses the IoC container to manage the beans and its dependency in the application. Thus simplifies the implementation of business logic in the application. The IoC is very important and it's very necessary to fully understand.

What is IoC?

The Inversion of Control is the process by which application defines the dependency and these dependencies are then satisfied in runtime by the Spring Framework. The IoC is also known as Dependency Injection(DI).

I the application dependencies are satisfied through:

  1. Constructor Injection
    Here the IoC container injects the dependency through the constuctor.
     
  2. Setter Injection
    The setter injection is done through the setters (setter method).
     
  3. Interface Injection
    The spring does not provide direct Interface Injection functionality.

In this section we will be presenting the examples of Spring Core module.

Spring Bean Example, Spring Bean Creation
In this tutorial you will see a very simple example of bean creation in spring framework.
 
Spring Setter Injection
Here in this example you will see another different type of injection known as setter injection
 
Spring Constructor Injection
In this example you will see Basic Constructor Injection
 
Spring Constructor arg type
In this example you will see how to inject the arguments into your bean by matching the constructor arguments type.
 
Spring Constructor arg index
In this example you will see how inject the arguments into your bean according to the constructor argument index.
 
The ref in Spring, Reference Injection
In this tutorial you will learn about Reference Injection in spring framework.
 
Constructor Based Dependency Injection in Spring
In this tutorial you will learn about the Constructor-based dependency injection in spring framework.
 
The idref in Spring, The idref element in spring framework
In this tutorial you will learn about the idref element in spring framework.
 
Spring Inner bean example, Inner Bean in spring framework
In this tutorial you will learn about the inner bean in spring framework.
 
Spring List Property Example
In this spring framework tutorial you will see the use of Lisp property.
 
Spring Set Property
In this tutorial you will learn about the spring set property.
 
Spring Map Property
In this tutorial you will learn about the spring map property.
 
Spring Props Tag, Spring prop key, Spring props prop
In this spring tutorial you will see the example of spring props tags.
 
Spring Bean Life Cycle methods, Spring Bean Life Cycle
In this tutorial you will see an example of spring bean life cycle.
 
Spring Collection Merging
In this tutorial you will see an example of spring collection merging.
 
Spring Map Example
In this tutorial you will see an example of implement map in spring.
 
Spring Null value, Set null value in Springs configuration file
In this example you will see how to set null value in the Spring configuration file
 
Spring p-namespace
In this tutorial you will see the use of p-namespace in spring framework.
 
Spring Lazy Initialization, Spring Lazy Loading example
In this tutorial you will learn about the Spring Lazy Initialization in the spring framework.
 
Spring Autowiring, Spring Autowire Tutorial
In this example you will learn about autowiring in spring framework.
 
Spring Autowiring byName
In this tutorial you will see an example of spring autowiring byName.
 
Spring Autowiring byType
In this tutorial you will see an example of spring autowiring byType.
 
Spring Autowiring Constructor
In this tutorial you will see an example of spring autowiring Constructor.
 
Spring Autowire Autodetect
In this tutorial you will see an example of spring autowiring autodetect mode.
 
Excluding a bean from autowiring in spring.
In this tutorial you will learn how to exclude a bean from autowiring in spring.
 
Spring Dependency-Check
In this tutorial you will learn how to check for dependency in spring framework.
 
Spring @Required Annotation
In this tutorial you will see about spring @required annotation with an example.
 
Spring Bean Scope Default
In this tutorial you will learn about Spring Bean Scope Default
 
Spring Bean Scope Prototype
In this tutorial you will learn about Spring Bean Scope Prototype
 
Spring Bean Configuration
In this tutorial you will learn about spring bean configuration and also see inheritance in bean configuration.
 
Spring Override Bean
In this tutorial you will see an example of overriding in spring framework.
 
Spring List Factory
In this tutorial you will learn about spring list factory and how list is used in spring framework.
 
Spring Set Factory
In this tutorial you will learn about spring set factory and also see the how set is used in spring framework.
 
Spring Map Factory, Spring Map Configuration
In this tutorial you will learn about Spring Map Factory and also see how to use map in spring framework.
 
Spring Date Property
In this tutorial you will learn about spring date property and how to set in spring configuration file.
 
Spring Date Editor, Spring Date Property Editor
In this tutorial you will see an example of a Spring Date Editor.
 
Spring CustomEditorConfigurer, Spring Custom Editor
In this tutorial you will learn about Spring CustomEditorConfigurer.
 
@Component Annotation in Spring, Spring Autoscan
In this tutorial you will learn about auto scanning feature of Spring framework.
 
Spring filter Bean
In this tutorial you will learn how to filter the component in spring framework.
 
Excluding filter in Spring
In this tutorial you will learn about how to exclude specified component in spring framework.
 
DisposableBean Interface and InitializingBean in Spring
In this tutorial you will learn about Disposable Bean Interface and Initializing Bean of Spring framework.
 
@PostConstruct and @PreDestroy example
In this tutorial you will learn about the Post Construct and Pre-Destroy construct of spring framework.
 
The registerShutdownHook in spring
In this tutorial you will learn about Register Shutdown Hook of Spring Framework
 
ApplicationContextAware in spring
In this tutorial you will learn about ApplicationContextAware Interface of Spring Framework.
 
Spring Bean Post Processor
In this tutorial you will learn about Spring Bean Post Processor.
 
Spring BeanNameAware
In this example you will see how to implement BeanNameAware in your bean class.
 
Spring Resource Example
In this tutorial you will learn about spring resource example.
 
Spring ResourceLoaderAware
In this tutorial you will learn about spring ResourceLoaderAware.
 
Spring Validation
In this tutorial you will see an example of validation in spring framework.
 
Advertisement

Related Tags for Spring IoC, Spring 3 IoC Container Tutorial and example code.:


Follow us on Twitter, or add us on Facebook or Google Plus to keep you updated with the recent trends of Java and other open source platforms.

Posted on: July 31, 2010

Recommend the tutorial

Advertisements Advertisements
 

 

 

DMCA.com