Template method pattern: Difference between revisions

Content deleted Content added
No edit summary
No edit summary
Line 3:
A template method defines the skeleton of an [[algorithm]] in terms of abstract operations which subclasses override to provide concrete behavior.
 
First a class is created that provides the basic steps of an algorithm by using abstract methods. Later on, subclasses change the abstract methods to implement real actions. Thus the general algorithm is saved in one place but the concrete steps may be changed by the subclasses.
 
== Example in Java ==