The Template Method pattern defines the skeleton of an algorithm in a base class, letting subclasses fill in specific steps without changing the overall structure. It captures a common process while allowing customization of individual steps.
What the Template Method pattern does
TEMPLATE METHOD → define an algorithm's overall STRUCTURE in a base method, with some STEPS
left for subclasses to implement:
→ the base class controls the overall flow (the "template")
→ subclasses override specific STEPS (the parts that vary)
→ the algorithm's structure is FIXED; the steps are customizable
→ "common process, customizable steps"
