Going over some really interesting demo CQRS code here commands and handlers are split in to separate interfaces.
public interface CommandHandler<in T>
{
void Handle(T command);
}
public interface EventHandler<in T>
{
void Handle(T @event);
}
I am auto-wiring the commands and events, it seems there may be a limitation with membus where it can only wireup CommandHandlers or EventHandlers, but either way it has me thinking:
Given both interfaces have a Handle method, what is the idea of splitting the commands and events in this way, when a single common command/event Handler
interface could be used instead?