导读
1、What is Spring Framework?
Spring makes it easy to create Java enterprise applications. It provides everything you need to embrace the Java language in an enterprise environment, with support for Groovy and Kotlin as alternative languag on the JVM,and with the flexibility to create many kingds or architecutres depending on an application’s needs.
2、Spring 包含哪些核心模块?
spring-core: 基础 API模块。
spring-beans: bean 相关,如依赖查找,依赖注入。
spring-aop: aop 处理,如动态代理,字节码提升。
spring-contenxt:事件驱动,注解驱动。
3、Spring 有哪些优点和不足?
Spring的优点:
- 面向接口,分层结构,有利项目的增量开发。
- 开源、免费、社区文档丰富。
spring的缺点:
- 将原本应该代码化的逻辑配置化,增加了出错的机会以及额外的负担。
- 调试阶段不直观,后期的bug对应阶段,不容易判断问题所在。
4、Spring 实现了哪些编程模型?
面向对象编程
契约接口:Aware、BeanPostProcessor…
设计模式:观察者模式、组合模式、模板模式…
对象继承:Abstract*类
面向切面编程
动态代理:JDKDynamicAopProxy
字节码提升:ASM、CGLib、Aspectj…
面向元编程
注解:模式注解(@Component、@Service、@Repository…)
配置:Environment抽象、PropertSources、BeanDefinition…
泛型:GenericTypeResolver、ResolvableType…
函数驱动
函数接口:ApplicationEventPublisher
Reactive: Spring Webflux
模块驱动
Maven Artifacts
Java 9 Automatic Modules
Spring @Enable*
5、Spring 有哪些经验和教训值得我们学习?
用户基础
设计模式
编程模型
API抽象设计
事务抽象、生命周期、AOP
设计思想
OOP、FD、IOC/DI、TDD
生态系统
设计模式
抽象工厂、原型模式、单例模式、适配器、装饰模式