Timeline for Domain driven design, can two aggregates have the same root?
Current License: CC BY-SA 3.0
6 events
| when toggle format | what | by | license | comment | |
|---|---|---|---|---|---|
| May 23, 2017 at 12:40 | history | edited | CommunityBot | replaced http://stackoverflow.com/ with https://stackoverflow.com/ | |
| May 24, 2015 at 12:58 | comment | added | DanielS | Yes. I think it's ok. | |
| May 24, 2015 at 12:55 | comment | added | omittones | So you're saying that both InactiveEmployee and ActiveEmployee are roots, and that it's ok they modify the same table, because they are completely different implementation and can't exist at the same time in the same transaction. To what would outside objects hold a reference to? | |
| May 24, 2015 at 12:35 | comment | added | DanielS | That's good to know. But, aggregate root is an object, not a property. All internal objects (Active/Inactive employee in your case) should be accessible thorough the root. It looks like you're redefining the definition of the aggregate root, thus making the question invalid | |
| May 24, 2015 at 11:17 | comment | added | omittones | I don't think it's a violation because they don't inherit from the same class. There is no BaseEmployee class. You cannot pass InactiveEmployee to a method expecting ActiveEmployee. When I say Employee is Aggregate Root, in my understanding that means both Active and InactiveEmployee have EmployeeID as their primary key. Any object that wishes to hold a reference to Active/InactiveEmployee will hold only EmployeeID, not the reference to entire object. | |
| May 24, 2015 at 3:07 | history | answered | DanielS | CC BY-SA 3.0 |