Is Invoker class optional in Command design pattern? Client needs to instantiate Concrete Command and Receiver for the command. Does client always need to instantiate Invoker an
As we know, java.lang.Runnable is one of the examples of command pattern where Thread class works as an invoker. We pass object of a Runnable class to Thread class and say start/run.
But we never create a client class which can invoke main thread.
So an invoker is not optional but it is not tightly coupled to client. So UML of command pattern never shows any relationship among client class and invoker class.
Another answer related to this question.