How to write functionality using DDD / CQRS

前端 未结 4 1160
既然无缘
既然无缘 2020-12-17 01:58

I have a bank account domain as listed below. There can be SavingsAccount, LoanAccount, FixedAccount and so on. One user can have multiple accounts. I need to add a new fun

4条回答
  •  遥遥无期
    2020-12-17 02:01

    First of all why do you need AccountManipulator? It does absolutely nothing, but makes the code more complicated.

    As for getting all accounts of a User, the most logical place to put this method would be in the User class. You could pass an account factory to that method, further implementation would probably depend on how you store accounts.

提交回复
热议问题