These two patterns are quite often mixed up, since they both perform an action when invoked.
However there are quite substantial difference:
1) Command should only be used as a trigger for a more complex action and should have no computational logic.
2) Strategy in the meantime encapsulates logical operations.
In simple terms command should have as little logic as possible, whereas strategy might encapsulate some complex calculations. It is also possible that a command triggers a strategy to be executed.
An example from WPF would be a particular control bound to an instance of ICommand which in turn could run a particular strategy.
Leave a Reply