I've been reading about DDD a lot lately and something I can't find too much about is the following scenario:
Let's say we have a Customer aggregate root and a Contract aggregate root. The reason they are both aggregate roots could be that contract could be accessed directly. A contract expects a Customer in the Create method to be valid, since it cannot exist without a customer.
However, there's two possibilities:
- Save the CustomerId on the Contract
- Save a list on the Customer with all the ContractId references for that given customer
Are both of these correct? If so, what's the main difference and when to choose one above the other?
When downvoting: please comment on what is wrong with this question instead of being silent.