spring中的设计模式_设计模式及其在Spring中的应用

本篇文章,按照不同的方式,整理了设计模式在spring中的应用。

Spring 中常见的设计模式

  1. 工厂模式 :BeanFactory
  2. 装饰器模式:BeanWrapper
  3. 代理模式:AopProxy
  4. 单例模式:ApplicationContext
  5. 委派模式:DispatcherServlet
  6. 策略模式:SimpleInstantiationStrategy
  7. 适配器模式:HandlerApdapter
  8. 模板方法模式:JdbcTemplate
  9. 观察者模式:ContextLoaderListener

Spring 四大模块中的典型的设计模式

  1. Spring IOC 工厂模式、单例模式、装饰器模式
  2. Spring AOP 代理模式、观察者模式
  3. Spring MVC 委派模式、适配器模式
  4. Spring JDBC 模板方法模式

Spring 中常见设计模式分类

94136b84f1d0c87a06c19e4228ef9644.png

各个模式对应的分析链接:

工厂模式在BeanFactory中:

Cloudistory:设计模式及其在Spring中的应用——工厂模式在BeanFactory中​zhuanlan.zhihu.com

单例模式在ApplicationContext中:

Cloudistory:设计模式及其在Spring中的应用——单例模式在ApplicationContext中​zhuanlan.zhihu.com

模板模式在JdbcTemplate中:

Cloudistory:设计模式及其在Spring中的应用——模板模式 在JdbcTemplate中​zhuanlan.zhihu.com
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值