[SpringBoot3.0 source code] automatic assembly source code analysis

Automatic assembly should be the most important symbol of SpringBoot, because this kind of design that the agreement is greater than the configuration can make programming easier, lower wages, and make java development no longer have a threshold.

Environment: JDK17,SpringBoot3.0

Because the previous chapters (IOC, AOP, transaction, Tomcat) are explained based on the SpringBoot3.0 environment, so we will briefly talk about the source code related to SpringBoot3.0 in the next few chapters.

The so-called automatic assembly is to automatically inject the configuration class of the third-party jar package into the IOC container, the common xxx-spring-boot-starter. After the introduction, we can directly take out the bean from the IOC container and use it.

For example, if it is introduced spring-boot-starter-data-redis: it can be used directly like this:

@Autowired
private RedisTemplate redisTemplate;

No, I should write the SpringBoot startup source code in advance, and then write this article, forget it, let’s do this first.

Our startup class:

@SpringBootApplication
publi

Guess you like

Origin blog.csdn.net/CSDN_SAVIOR/article/details/128914866