Template Method pattern एक base class में एक algorithm का skeleton परिभाषित करता है, subclasses को समग्र संरचना बदले बिना विशिष्ट steps भरने देता है। यह एक सामान्य process को capture करता है जबकि व्यक्तिगत steps के customization की अनुमति देता है।
Template Method pattern क्या करता है
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"
