I avoid using massive operations as much as possible when using a rich domain model.
Some party may be replaced by events. For example, I need a daily report on the number of orders.
Batch Solution:
The planning task, which starts at the end of the day, collects data from orders placed today.
Or use events
PlaceOrderService publishes an OrderPlacedEvent when a new order is placed. And eventHandler accepts the event and inserts it into T_ORDER_COUNT_ENTRY
|TODAY |ORDER_ID|
|2012-04-01|123 |
|2012-04-01|124 |
We could use SQL count () to compute a report on the daily order schedule.
. , , 30 .
, , ().
, , OrderIsOverdue. , orderId, , .
, , , . , .