--
You received this message because you are subscribed to the Google Groups "DDD/CQRS" group.
To unsubscribe from this group and stop receiving emails from it, send an email to dddcqrs+unsubscribe@googlegroups.com.
Visit this group at https://groups.google.com/group/dddcqrs.
For more options, visit https://groups.google.com/d/optout.
Ultimately they are just messages. Instead of dealing with the complexity of 'layers' why not wrap up these external services in an interface or delegate? Here's an example in c#async Task<Result> Handle(CreateQuote command, CancellationToken ct) {var serviceATask = _callServiceA(command.Stuff, ct); // just delegates injected into your handler's constructorvar serviceBTask = _callServiceB(command.OtherStuff, ct);await Task.WhenAll(serviceATask, serviceBTask); // assuming you don't need the result of one query to go into anothervar serviceAResult = await serviceATask;var serviceBResult = await serviceBTask;var quote = Quote.Create(serviceAResult, serviceBResult, command.StillOtherStuff);await _quotes.Save(quote, ct);return new Result(quote.Identifier);}
On Thu, Jun 22, 2017 at 10:33 AM, Mike Lazell <mikel...@gmail.com> wrote:
Hi there,I am in the process of scaffolding a new project and as part of it I have a Command which creates an entity (CreateQuote). As part of that process it needs to get a value from an external service, and then another value from another external service and finally persist a combined entity in the DB and then return a response.As things stands I have CreateQuote in the Command layer and 2 services in the Query layer.My concern then is that in the Command layer I need to call the query layer to get these before then persisting the entity.Does this sound correct? Or are the 2 external service calls commands also?Thanks in advance.Mike
--
You received this message because you are subscribed to the Google Groups "DDD/CQRS" group.
To unsubscribe from this group and stop receiving emails from it, send an email to dddcqrs+u...@googlegroups.com.
Visit this group at https://groups.google.com/group/dddcqrs.
For more options, visit https://groups.google.com/d/optout.
--
You received this message because you are subscribed to the Google Groups "DDD/CQRS" group.
To unsubscribe from this group and stop receiving emails from it, send an email to dddcqrs+unsubscribe@googlegroups.com.
--
You received this message because you are subscribed to the Google Groups "DDD/CQRS" group.
To unsubscribe from this group and stop receiving emails from it, send an email to dddcqrs+u...@googlegroups.com.