samedi 5 décembre 2020

How to design the aggregate root?

I want to refactor my project with DDD. There are three object, such as bankcard, channel and user. There relation as follows:

  1. A bankcard can sign a contract with multi channel.
  2. A user can bind multi bankcards.
  3. A bankcard can be bound to multi users. Now the project has three tables, such as bankcard table, bankcards and channels contract table, bankcards and users relationship table. I want to design bankcard as entity, user and channel as value object(user entity and channel entity be maintained at other domain). So how should I design the aggregate root. Consider bankcard as aggregate and the channel list, user list as aggregate root's property, or design bankcard, bankcard-sign-contract, bankcard-user-relationship as aggregate root?

Aucun commentaire:

Enregistrer un commentaire