设计模式-模板方法设计模式--Template Method design pattern
/**
* Abstract implementation of the {@link org.springframework.context.ApplicationContext}
* interface. Doesn't mandate the type of storage used for configuration; simply
* implements common context functionality. Uses the Template Method design pattern,
* requiring concrete subclasses to implement abstract methods.
*
* <p>In contrast to a plain BeanFactory, an ApplicationContext is supposed
* to detect special beans defined in its internal bean factory:
* Therefore, this class automatically registers
* {@link org.springframework.beans.factory.config.BeanFactoryPostProcessor BeanFactoryPostProcessors},
* {@link org.springframework.beans.factory.config.BeanPostProcessor BeanPostProcessors}
* and {@link org.springframework.context.ApplicationListener ApplicationListeners}
* which are defined as beans in the context.
*
* <p>A {@link org.springframework.context.MessageSource} may also be supplied
* as a bean in the context, with the name "messageSource"; otherwise, message
* resolution is delegated to the parent context. Furthermore, a multicaster
* for application events can be supplied as "applicationEventMulticaster" bean
* of type {@link org.springframework.context.event.ApplicationEventMulticaster}
* in the context; otherwise, a default multicaster of type
* {@link org.springframework.context.event.SimpleApplicationEventMulticaster} will be used.
*
* <p>Implements resource loading through extending
* {@link org.springframework.core.io.DefaultResourceLoader}.
* Consequently treats non-URL resource paths as class path resources
* (supporting full class path resource names that include the package path,
* e.g. "mypackage/myresource.dat"), unless the {@link #getResourceByPath}
* method is overwritten in a subclass.
今天看spring的代码,AbstractApplicationContext中的注释有提到Template Method design pattern ,就查了一下这种设计模式。
参考:https://blog.csdn.net/qq_24692041/article/details/60961880
这种设计模式,就是在父类中定义处理流程的框架,在子类中实现具体的处理方式。我的理解是,父类处理步骤,子类处理数据。其中父类的方法基于里氏转换原则,要final掉。
设计模式-模板方法设计模式--Template Method design pattern的更多相关文章
- Template Method Design Pattern in Java
		
Template Method is a behavioral design pattern and it’s used to create a method stub and deferring s ...
 - 设计模式 - 模板方法模式(template method pattern) JFrame 具体解释
		
模板方法模式(template method pattern) JFrame 具体解释 本文地址: http://blog.csdn.net/caroline_wendy 參考模板方法模式(templ ...
 - 设计模式 - 模板方法模式(template method pattern) 排序(sort) 具体解释
		
模板方法模式(template method pattern) 排序(sort) 具体解释 本文地址: http://blog.csdn.net/caroline_wendy 參考模板方法模式(tem ...
 - 设计模式 - 模板方法模式(template method pattern) 具体解释
		
模板方法模式(template method pattern) 详细解释 本文地址: http://blog.csdn.net/caroline_wendy 模板方法模式(template metho ...
 - java设计模式 模板方法模式Template Method
		
设计模式(Design pattern)是一套被反复使用.多数人知晓的.经过分类编目的.代码设计经验的总结.使用设计模式是为了可重用代码.让代码更容易被他人理解.保证代码可靠性.毫无疑问,设计模式于己 ...
 - 设计模式—模板方法(template method)
		
一.定义 百度百科给的定义:定义一个操作中的算法骨架(稳定),而将一些步骤延迟到子类中(变化).Template Method使得子类可以不改变一个算法的结构即可重定义该算法的某些特定步骤. 如何做到 ...
 - C#设计模式-模板方法模式(Template Method)
		
概念 模板指一些可以套用的公共内容,例如网页模板是当网站中有许多页面版式色彩相同的情况下,将其定义为网页模板,并定义其中部分可编辑,部分不可编辑,那么在利用网页模板制作其他页面时就会很方便,不易出错. ...
 - 乐在其中设计模式(C#) - 模板方法模式(Template Method Pattern)
		
原文:乐在其中设计模式(C#) - 模板方法模式(Template Method Pattern) [索引页][源码下载] 乐在其中设计模式(C#) - 模板方法模式(Template Method ...
 - 二十四种设计模式:模板方法模式(Template Method Pattern)
		
模板方法模式(Template Method Pattern) 介绍定义一个操作中的算法的骨架,而将一些步骤延迟到子类中.Template Method使得子类可以不改变一个算法的结构即可重定义该算法 ...
 
随机推荐
- Docker 部署Jira8.1.0
			
Jira与Confluence一样,都需要用到独立的数据库,对于数据库的安装我们不做介绍,主要介绍如何用Docker部署Jira以及对Jira进行破解的操作. 1.数据库准备 关于数据库官方文档说明: ...
 - redis 实现登陆次数限制
			
title: redis-login-limitation 利用 redis 实现登陆次数限制, 注解 + aop, 核心代码很简单. 基本思路 比如希望达到的要求是这样: 在 1min 内登陆异常次 ...
 - mq 探究
			
一 mq简介(message queue) 消息队列技术是分布式应用间交互信息的一种技术. 消息队列可驻留在内存或磁盘上,队列存储消息直到它们被应用程序读走 通过消息队列,应用程序可独立地执行-它们不 ...
 - Java基础---Java三元运算
			
一元运算符:只需要一个数据就可以进行操作的运算符.例如:取反!.自增++.自减--二元运算符:需要两个数据才可以进行操作的运算符.例如:加法+.赋值=三元运算符:需要三个数据才可以进行操作的运算符. ...
 - Netty中两种Keepalive的区别
			
在Server端开启TCP keepalive: 两种方式 serverBootstrap.childOption(ChannelOption.SO_KEEPALIVE, true); serverB ...
 - JSON文件转为Excel
			
前言 今天在帮老师做年终党统的时候,发现管理平台上没有将正在发展的同志的信息导出功能,只能一个一个点击进去查看,操作起来步骤很多很麻烦,所以我就想到了"扒"一下这个网页,扒下来发现 ...
 - Python【HTML基础】
			
HTML基础 HTML(Hyper Text Markup Language)超文本标记语言 #HTML是一种用来描述网页的语言,HTML之于网页就好比建筑图纸之于建筑 +++++++++++++++ ...
 - python多任务基础
			
1.多任务:两个程序段同时运行2.为某个函数创建线程并启动: import threading 线程名 = threading.Thread(target = 函数名,args = 参数元组) #创建 ...
 - 十、LCD的framebuffer设备驱动
			
在读者学习本章以及后续LCD相关章节之前,最好拥有LCD裸机基础,可以参考:LCD编程. 在内核中,表示LCD使用的是framebuffer(帧缓冲,简写为fb),其内容对应于屏幕上的界面显示.修改f ...
 - asp.net core-6.Bind读取配置文件到C#实例中
			
1,创建asp.net core web应用程序,选择空网站 2,创建一个appsettings.json文件 为什么要叫appsettings.json呢?因为在Iwebhost启动的时候没有添加任 ...