Skip to content
Discussion options

You must be logged in to vote

deposit_funds_command_handler.rs: Handles the deposit_funds_command.rs by using the bank_account_repository.rs to get the bank account from the data store then calls the deposit function on the aggregate and then handles emitting the returned event or error.

This doesn't isolate the aggregate as much as we'd like. The problem here is that some business logic exists in deposit_funds_command_handler.rs, even if it is only a bank_account_repository->lookup(), and this violates DDD.

Business logic tends to grow over time, for instance if we added multiple currencies:

  • We'll need another lookup for exchange rate.
  • Do we convert before calling the function on the aggregate? If so what happens …

Replies: 1 comment 5 replies

Comment options

You must be logged in to vote
5 replies
@filwaline
Comment options

@davegarred
Comment options

@filwaline
Comment options

@filwaline
Comment options

@davegarred
Comment options

Answer selected by StephenGilboy
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants