Template Method pattern ایک base class میں الگورتھم کی ہڈی کو define کرتا ہے، جو 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"
