SpringBoot 自动装配的原理分析
关于 SpringBoot 的自动装配功能,相信是每一个 Java 程序员天天都会用到的一个功能,但是它究竟是如何实现的呢?今天阿粉来带大家看一下。 自动装配案例 首先我们通过一个案例来看一下自动装配的效果,创建一个 SpringBoot 的项目,在 pom 文件中加入下面的依赖。 <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-web</artifactId> </dependency> <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-data-redis</artifactId> </dependency> 其中 web 的依赖表示我们这是一个 web 项目,redis 的依赖就是....