Command Dispatcher Delegate
A common interface for objects which need to dispatch the commands, but are unable to implement the CommandDispatcher.
A typical example of a CommandDispatcherDelegate
usage is a routine, which simultaneously dispatches different types of messages in addition to Command
s.
In this case such a class would have to implement several MessageDispatcher child interfaces (such as CommandDispatcher or EventDispatcher). However, it is impossible to implement the same getMessageClasses() method several times with the different types of MessageClass
es returned.
The same interference takes place in attempt to implement UnicastDispatcher.dispatch(MessageEnvelope) method with the different types of MessageEnvelope
s dispatches simultaneously.
That's why unlike MessageDispatcher, this interface defines its own contract for declaring the dispatched command classes, which does not interfere with the MessageDispatcher
API.