Reading about DDD, i have read that it is needed to have a repository per each aggregate entity.
For example, in an ordering system, I should have a repository for the order and another repository for the buyer.
If i am not wrong, a unit of work it is to ensure that all the actions are processed as a unit, so if i do medications in the order and in the buyer, I could ensure that all is done or nothing.
Bit i have read that it is better to ensure to modify one aggregate each time, so it shouldn't recommended to modify orders and buyers in the same process.
So this makes me think that if in each process I modify one aggregate, is it really needed a unit of work?
Perhaps the example that I expose it is too simplicity, and perhaps in some complex process, if i modify an aggregate it affects to another aggregate. But it is advise that una aggregate shouldn't to modify another aggregates outside of the aggregate that I am modifying. So again, I am wondering if it is really useful a unit of work if I follow DDD.
In summary. Is it really needed a unit of work with DDD? If in some cases it is useful, in which cases?
Thanks.