Can an Entity be Shared across many Aggregates?
| Newsgroups | gmane.comp.programming.domain-driven-design |
|---|---|
| Message-ID | <[email protected]> |
Can an entity be shared across many aggregates? In the Blue Book (Evans), in chap 6 on aggregates there is an example of entities Tire and Wheel being used in the aggregate root Car. If this example was extended to have two aggregates, Car and Truck would it be acceptable to use Tire and Wheel again with Truck? In the domain I'm currently modeling, there is an entity called Account. It's a very specific domain type of account. Right now I have it modeled as an entity in an aggregate root that manages it's life-cycle, but it's used heavily in other aggregate roots as a reference. It would suggest that what I really need is to make Account an aggregate root in it's own right so I can reference it's ID in other aggregates. Because from my understanding it's not acceptable to reference an entity's Id or the entity itself outside it's owning aggregate. What am I missing? Apologizes for the two part question.