2018-05-06
Template Method Design pattern
The skeleton of an algorithm in an operation is defined in a method of the parent class, and some steps are deferred to the subclass because the implementation details of the different subclasses are different. The template method allows subclasses to redefine some specific steps of the algorithm without altering the structure of an algorithm.
Abstract Parent class: defines the business skeleton in the operation, and defers these steps to the subclass.
The abstract parent class provides at least two methods:
1) Template method: A general approach, that is, the template (skeleton of the overall algorithm).
2) abstract method: a specific business function implementation, complete by subclasses.
Reference:https://www.cnblogs.com/liaoweipeng/p/5790395.html
51868973
Ii. Java Object-oriented (15) _ Template Method design pattern