Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>(Disclaimer, I am just starting to get a grasp on DDD. or at least believe doing it :) )</p> <p>I will second Mark on this one and emphasize 2 point that took me some times to realize.</p> <ul> <li>Think about your object in term of aggregates, which lead to <blockquote> <p>The point is that either you load the children together with the parent or you load them separately</p> </blockquote></li> </ul> <p>The difficult part is to think about the aggregate for your problem at hand and not to focus the DB structure supporting it.<br> An example that emphasizes this point i customer.Orders. Do you really need <em>all</em> the orders of your customer for adding a new order? usually not. what if she has 1 millin of them?<br> You might need something like OutstandingAmount or AmountBuyedLastMonth in order to fulfill some scenarios like "AcceptNewOrder" or ApplyCustomerCareProgram. </p> <ul> <li>Is the product the real aggregate root for your sceanrio? <blockquote> <p>What if Product is not an Aggregate Root? </p> </blockquote></li> </ul> <p>i.e. are you going to manipulate the item or the product?<br> If it is the product, do you need the ItemWithMaxSomething or do you need MaxSomethingOfItemsInProduct? </p> <ul> <li>Another myth: PI means You don't need to think about the DB</li> </ul> <p>Given that you really need the item with maxSomething in your scenario, then you need to know what it means in terms of database operation in order to choose the right implementation, either through a service or a property.<br> For example if a product has a huge number of items, a solution might be to have the ID of the Item recorded with the product in the db instead of iterating over the all list.</p> <p><em>The difficult part for me in DDD is to define the right aggregates. I feel more and more that if I need to rely on lazy loading then I might have overseen some context boundary.</em> </p> <p>hope this helps :)</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload