In book Applying Domain-Driven Design With Examples in C# in Chapter 4 (A first Sketch) on point 4. Concurrency Conflict Detection Is Important i don't understand why the author has choose this aggregates.Customer has his own aggregate and Order has his own aggregate.
I think Customer should have a reference to his orders.
Order have identity only with a customer. I'm not see one situation to get an order from database by his id. But if I apply this logic then, in my domain model, I have few complex aggregates that contain all of my entities and values objects. I don't want this.
When get a customer from the database it will not load directly his orders (Lazy Loading). So this is not an argument.
If customer is used in different scenarios then it's better to clear customer for that references only useful in one scenario. I guess that this is one reason for make an aggregate for order and have an "indirect reference" to his orders.
So what are the real reasons for choosing an aggregate?
I have another misunderstanding. Order has more OrderLine. OrderLine has one product. Why is permitted as OrderLine to have a reference to an object (Product) outside aggregate order?