I learned about the Command Design pattern and saw different implementations of it:
Receiver receiver = new Receiver(); Command command = new ConcreteCommand(receiver); Invoker invoker = new Invoker(); invoker.SetCommand(command); invoker.ExecuteCommand();
Remote remote = new Remote(); DVDPlayCommand dvdPlayCommand = new DVDPlayCommand(); remote.Invoke(dvdPlayCommand);
Probably, I missed something, but the second implementation seems less complicated and more clear from my point of view.
First implementation calling chain:
ExecuteCommand() calls to
Execute() calls to
Second implementation calling chain:
Invoke() calls to
Does the first implementation have advantages over the second?