spring-13、Spring 框架中用到了哪些设计模式

Spring框架中使用到了大量的设计模式,下面列举了比较有代表性的:

  • 代理模式—在AOP和remoting中被用的比较多。
  • 单例模式—在spring配置文件中定义的bean默认为单例模式。
  • 模板方法—用来解决代码重复的问题。比如. RestTemplate, JmsTemplateJpaTemplate。
  • 工厂模式—BeanFactory用来创建对象的实例。
  • 适配器--spring aop
  • 装饰器--spring data  hashmapper
  • 观察者-- spring 时间驱动模型
  • 回调--Spring ResourceLoaderAware回调接口
原文地址:https://www.cnblogs.com/chenxiaoxian/p/10431721.html