views:

104

answers:

1

Hi. I've read 3 descriptions of the command design pattern: wikipedia, dofactory and source making.

In all of them, the UML shows a relation between the client to the receiver & the concrete command, but no relation to the invoker. But in all 3 examples the client is the one that initiates the invoker and call its Execute method.

I think that should be a relation to the invoker as well. Am I missing somthing in here? Maybe even a basic UML knowladge?

+2  A: 

That's probably a limitation of the simple examples. There is no need to have a relationship between the client and the invoker in practice.

The client could serialise the command object and send it to a remote service for execution for example, or the client may add the command to a queue for another thread to de-queue and execute later on.

Paolo