First, spring1.x era
In the spring1.x era, the bean is configured through XML files, and as the project expands, the XML configuration needs to be split into different configuration files, frequently switching between Java classes and XML configuration files.
Ii. the era of spring2.x
With the annotations supported by JDK1.5, spring2.x can use annotations to declare and inject beans, greatly reducing the XML configuration file, and greatly simplifying the development of the project.
So, the question is, should we use XML or annotate it?
Best Practices:
1, the application of the basic configuration with XML, such as: Data sources, resource files, etc.;
2, business development with annotations, such as: Service injection beans, etc.;
Three, spring3.x to spring4.x
Java configuration is provided from spring3.x, and Java configuration is used to better understand the bean you are configuring, and now we are in this era, and both spring4.x and Springboot recommend the use of Java configuration.
Springboot Study (i) the development of--spring