Springboot Study (i) the development of--spring

Source: Internet
Author: User

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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.