Re: Can an Entity be Shared across many Aggregates?
Rikard Pavelic <[email protected]>
| Newsgroups | gmane.comp.programming.domain-driven-design |
|---|---|
| Message-ID | <[email protected]> |
On 10.11.2013. 14:57, [email protected] wrote: > > > 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. > > > While you shouldn't share an entity instance (this would break aggregate boundary), sharing entity type across multiple aggregates/entities is not a problem (in my book). Regards, Rikard -- Rikard Pavelic https://dsl-platform.com/ ------------------------------------ Yahoo Groups Links <*> To visit your group on the web, go to: http://groups.yahoo.com/group/domaindrivendesign/ <*> Your email settings: Individual Email | Traditional <*> To change settings online go to: http://groups.yahoo.com/group/domaindrivendesign/join (Yahoo! ID required) <*> To change settings via email: [email protected] [email protected] <*> To unsubscribe from this group, send an email to: [email protected] <*> Your use of Yahoo Groups is subject to: http://info.yahoo.com/legal/us/yahoo/utos/terms/