Skip to content

Spring 框架

Spring Boot

自动配置原理

@SpringBootApplication = @Configuration + @EnableAutoConfiguration + @ComponentScan

常用注解

  • @RestController
  • @RequestMapping
  • @Autowired
  • @Service / @Repository / @Component

Spring Cloud

核心组件

  • Eureka - 服务注册与发现
  • Ribbon - 负载均衡
  • Feign - 声明式HTTP客户端
  • Hystrix - 熔断器
  • Gateway - 网关

面试题精选

Spring IOC

控制反转(Inversion of Control),将对象的创建和管理交给 Spring 容器。

Spring AOP

面向切面编程,底层使用动态代理(JDK动态代理 / CGLIB)。

事务传播行为

  • REQUIRED(默认)
  • REQUIRES_NEW
  • NESTED
  • SUPPORTS

基于 MIT 许可发布