Overview of spring3.0 container?

Spring Container

The interface org.springframework.context.ApplicationContext is the Spring IOC container.The responsibilities of container are instantiating, configuring, and assembling the beans.
After getting the instructions container instantiates, configures, and assembles the objects by reading configuration metadata.The configuration metadata is nothing but it is represented in XML, Java annotations or Java code. 
The application classes and configuration metadata are combined. After the ApplicationContext is created and initialized, we have a fully configured and executable system or application ready for work.

In standalone applications it is common to create an instance of
ClassPathXmlApplicationContext or FileSystemXmlApplicationContext. While XML has been the traditional format for defining configuration metadata you can instruct the container to use Java annotations or code as the metadata format by providing a small amount of XML configuration to declaratively enable support for these additional metadata formats.

The following diagram show you view of how Spring works.

Configuration metadata
There are two way we can configure the metadata:
  • Annotation-based configuration: In Spring 2.5 we were using annotation-based configuration metadata.
  • Java-based configuration: In Spring 3,we can define beans external to our application classes by using Java rather than XML files as @Configuration, @Bean, @Import and @DependsOn annotations.

0 comments :

Post a Comment