Marked my aggregate roots with 1;2;3. Looks quite nice - almost like grapes.
Thing I dislike is an entity that's marked with red arrow.
Let's imagine that:
- AR #1 is company
- AR #2 is office
- AR #3 is employee
- Entity marked with red arrow is named
Country
- Company sets the rules from which countries it hires employees (on hiring,
company.Countries.Contains(employee.Country)
must be true)
- Company sets the rules from which countries it hires employees (on hiring,
I somehow see this quite unimportant part of domain (maybe it does not sound like that in this example one), and I would like to avoid promoting Country to aggregate root.
Glossary about aggregate roots says:
Transient references to the internal members can be passed out for use within a single operation only.
So - does introducing something like 'EmployeeCountry', removing reference to company Country and checking if Employee country matches any company country on hiring operation sounds reasonable?
Any other ideas?
How can I get my grapes look like they should?