23 Jun 06:06
Aggregate root modeling
thecsharpmafia <thecsharpmafia <at> yahoo.com>
2009-06-23 04:06:40 GMT
2009-06-23 04:06:40 GMT
I have a question about modeling aggregate roots. Suppose I have a few classes : ContactInfo, Address, Phone, Country, CountryRegion. I have so far modeled it to the following roots : ContactInfo Address (has Country and CountryRegion objects) Phone Country (has CountryRegion object) CountryRegion It seems since ContactInfo holds a CountryRegion object, CountryRegion must be its own root. But this seems weird to me as CountryRegion means nothing without Country. Ideally CountryRegion would be under Country, establishing 2 roots - ContactInfo and Country. But I will not be able to access CountryRegion under Country, per DDD rules of only going through the root. Anybody have better ways to model this? Thanks. ------------------------------------
RSS Feed