I wonder whether I should model dependent objects as aggregate roots. Let's say I have a TaskList
and this list has Task
s. A Task
cannot exist without a TaskList
but it can be viewed and edited separately. There are no special conditions that the TaskList
could check when a Task is modified or added - which would be the main reason for an aggregate root, I think. The only condition is, that the TaskList
and its tasks can only be edited by the owner. It would be easy to ensure this condition if the TaskList
had an owner and the Tasks could only be edited through the TaskList. Otherwise I would need to detect the owner transetivly or add an owner field to the tasks.
So what is appropriate here?
- Task and TaskList both as aggregate roots and each with an owner field
- Only TaskList as aggregate root and Tasks as dependent entities
Am I missing something important?