Different output models for different use cases
Once the use case has done its work, what should it return to the caller?
Similar to the input, it has benefits if the output is as specific to the use case as possible. The output should only include the data that is really needed for the caller to work.
In the example code of the Send money use case, we return a Boolean. This is the minimal and most specific value we could possibly return in this context.
We might be tempted to return a complete Account with the updated entity to the caller. Perhaps the caller is interested in the new balance of the account.
But do we really want to make the Send money use case return this data? Does the caller really need it? If so, shouldn’t we create a dedicated use case for accessing that data that can be used by different callers?
There is no single right answer to these questions. But we should ask them to try to keep our use cases as specific as possible. When in doubt,...