I'm new to DDD and I'm stuck with many-to-many relationships. E.g. we have two aggregate roots - Tasks and Workers.
Contract is definitely not aggregate root, because it has no sense without Task and Worker. So, it should be part of some aggregate. But which aggregate should it belong to? We need to know both summary costs of all task contracts and summary costs of all worker contracts. And it's natural for me to have contracts collection both in Task and in Worker.
Well, I can move Costs calculation to domain service, but I afraid it's a step forward to anemic model. Is there common way to deal with many-to-many relationships and preserve reach domain model?
Thanks!