I. Configuring beans in the Spring IOC container
- To configure the bean through the bean node in the XML file
(1) must be unique within the IOC container
(2) If the ID is not specified, spring automatically assigns the permission qualifier class name to the Bean
(3) ID can specify more than one name, the name can be separated by commas, semicolons, or spaces
Second, spring container
- It must be initialized before the spring IOC container reads the bean configuration to create the bean instance. You can get the bean instance from the IOC container and use it only after the container is instantiated.
- Spring provides two types of IOC container implementations:
Basic implementation of BEANFACTORY:IOC container
ApplicationContext: Provides more advanced features and is a sub-interface of the beanfactory.
3. Beanfactory is the infrastructure of the spring framework for spring itself; ApplicationContext developers for the spring framework, In almost all applications, the applicationcontext is used directly rather than the underlying beanfactory
Third, ApplicationContext
1. ApplicationContext's main implementation class:
-classpathxmlapplicationcontext: Loading a configuration file from a Classpath
-filesystemxmlapplicationcontext: Loading configuration files from the file system
Spring Tutorial Two: Bean Configuration in spring 1---XML file-based approach