Command pattern एक विनंती ऑब्जेक्ट म्हणून एन्कॅप्सुलेट करते — एक क्रिया एक स्वतंत्र ऑब्जेक्टमध्ये रूपांतरित करते ज्यामध्ये त्याची सर्व माहिती असते. हे queuing, logging, undo/redo, आणि विनंती करणारा आणि कार्यकारी यांच्यातील decoupling सक्षम करते.
Command pattern काय करते
COMMAND → encapsulate an action/request as an OBJECT (with its data and an execute method):
→ a command object knows WHAT to do and has the info to do it
→ the invoker triggers commands without knowing their details
→ decouples the object that INVOKES from the object that PERFORMS the action
→ "turn an action into an object" → store, pass, queue, log, undo it
