I have 2 aggregates: Occupation
and WorkActivity
.
An Occupation
can have multiple WorkActivity
. A WorkActivity
can also belong to many Occupation
.
The aggregate is a basic element of transfer of data storage, according to Martin Fowler.
So the WorkActivity
can't be a value object of the Occupation
because when updating the Occupation
, I don't want to update the WorkActivity
, but the list of WorkActivity
only. I would call it WorkActivities
.
And the Occupation
needs to know just the content
of the WorkActivity
, not other information like description
, image
, etc.
The question is should I store only the id
s of the WorkActivity
inside the Occupation
as a value object, or should I create new WorkActivity
value object with just needed information inside Occupation
aggregate?