设计模式(java源码实现)
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

13 lines
283 B

5 years ago
模版方法
模型:行为模型
思路:
1.将流程和具体实现分开
2.父类负责流程,子类负责具体实现
3.父类和子类协同一致实现程序
坏处:
1.在没有看到父类的源码情况下,子类无法实现
体现里氏替换原则