Template Method प्याटर्न आधार क्लासमा एल्गोरिदमको हड्डी परिभाषित गर्छ, सबक्लासलाई समग्र संरचना परिवर्तन नगरी विशिष्ट चरणहरू भर्न दिन्छ। यो एक सामान्य प्रक्रिया क्याप्चर गर्छ जबकि व्यक्तिगत चरणहरूको अनुकूलन अनुमति दिन्छ।
Template Method प्याटर्नले के गर्छ
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"
