I'm starting to learn about DDD and worry about the performance implications for extracting object objects from persistence and then restructuring them in view mode for the user interface.
Let's say that I have two cumulative roots:
Person Orders
------ -------
personId orderId
name personId
Each consolidated root has its own repository responsible for the basic CRUD operations for the entire aggregate.
Let's say that the following columns are required for the user interface:
viewmodel
personName
numberOfOrders
I can imagine two ways in which I can populate this view model:
- Eagerly load all human entities, eagerly load all orders based on personId, restructure the loaded objects in the viewmodel.
- JOIN/COUNT (orderId) , .
, 1 , , . 2 .
2 () , " " " ?"? " " , ? - , DDD ?
, DDD , ?
/
, - /. , , , . .