I'm trying to implement data repositories based upon the aggregate roots. However, I'm not sure if this is the best way and I need your feedback.
Here are the aggregate roots of my system I've come up with (included are their childs indented below)
Customer (Has Data Repository)
CustomerAccount
CustomerAccountPerson
CustomerOptions
CustomerCustomField
CustomerCustomFieldData
CustomerFile
CustomerNote
CustomerLoginLog
..... and more
Order (Has Data Repository)
OrderLineItem
OrderStatusLog
OrderFlag
OrderOutsourcing
..... and more
Lead (Has Data Repository)
LeadNote
LeadSource
LeadStatus
LeadStatusLog
..... and more
Invoice (Has Data Repository)
InvoiceOrder
InvoicePayment
Plus more... the struggle I have is that, if proper data repositories are based upon aggregate roots, then technically should I have the Customer repository consume the Orders repository and instead of having two separate repositories for Customer and Order, instead we have Customer, with orders included in it
The only reason I have it separated is because of the large number of sub tables/items under the customer and order data repository.
I'm really interested in hearing how others would handle a situation like this when designing their data repositories and any other suggestions they might have for me.
Thanks in advance.