Cool. Function from command->event(s). That is clear.
If you don't mind, can I please just get a clear understanding how you see this:
The ExternalServiceA has a priced service from which we get information, used within a use case triggered by command EvaluteSomething.
The EvaluateSomething use case need information from ExternalServiceA to do the evaluation of Something (the evaluation takes place in the aggregate).
If ExternalServiceA has already been called before, the information is already present and the service shall not be called again.
1. In the command is present whether ExternalServiceA was called before or not.
We assume command has information that it was not called before.
2. In context, the service call is made.
3. The result is passed into the aggregate.
4. The aggregate output events.
In order to actually get the information about the service call persisted, the resulting events probably include one like SomeInfoFromExternalServiceRetreived.
Is this more or less how you see it?
The reason I ask is because currently, aggregates are to us the exact opposite of very very simple.
Within a method in an aggregate, all needed to output events occur.
That means:
1. Validate that this aggregate did not do this call before.
2. Do the call if it didn't.
3. Parse results.
4. Produce events telling the world that the above just happened.
It would be great to know why the first approach is better than the second.