The 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"
