Modeli Command përfshin një kërkesë si objekt — duke e kthyer një veprim në një objekt të pavarur me të gjithë informacionin e tij. Kjo mundëson radhësimin, regjistrimin, zhbërjen/ribërjen dhe shkëputjen e kërkuesit nga ekzekutuesi.
Çfarë bën modeli Command
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
