In fact, how our application service will look and behave is very similar to a bunch of command handlers. A classic application service exposes some methods with multiple parameters, like this:
public interface IPaymentApplicationService
{
Guid Authorize(
string creditCardNumber,
int expiryYear,
int expiryMonth,
int cvcCode,
intcamount);
void Capture(Guid authorizationId);
}
Using this kind of declaration is perfectly fine, except it doesn't play that well with the composition. It is not easy to add such an application service to a pipeline, where we have logging, retry policies, and so on. To make a pipeline, we need all our handlers to have compatible parameters, but these methods of IPaymentApplicationService just don't allow us to go that way. Every other call in the pipeline must have the same set of parameters...