为什么使用设计模式?
* 设计模式可以帮助我们更加优雅代码;
* 合理的使用设计模式,更利于项目后期的维护;
* 设计模式一般是组合使用的;
spring中的设计模式
* spring四大模块:
* IOC , AOP , MVC , JDBC
设计模式名称 举例
工厂模式 BeanFactory
装饰器模式 BeanWrapper
代理模式 AopProxy
委派模式 DispatcherServlet
策略模式 HandlerMapping
适配器模式 HandlerAdapter
模板模式 JdbcTemplate
观察者模式 ContextLoaderListener
设计模式分类
创建型模式
工厂模式 Factory Pattern
单例模式 Singleton Pattern
原型模式 Prototype Pattern
结构型模式
适配器模式 Adapter Pattern
装饰器模式 Decorator Pattern
代理模式 Proxy Pattern
行为性模式
策略模式 Strategy Pattern
模板模式 Template Pattern
委派模式 Delegate Pattern
观察者模式 Observer Pattern