From How are Value Objects stored in the database? :
Assume that a Company and Person both have the same mail Address. Which of these statements do consider valid?
1."If I modify Company.Address, I want Person.Address to automatically get those changes"
2."If I modify Company.Address, it must not affect Person.Address"
If 1 is true, Address should be an Entity
If 2 is true, Address should be a Value Object.
Shouldn't in the above model the mail Address
be a Value Object, since even if Company
and Person
have same mail, this mail still doesn't have a conceptual identity?
In other words, if initially Company
and Person
share [email protected], but then get new mail [email protected], then we can argue that mail address [email protected] itself didn't changed, instead Company
and Person
replaced it by [email protected] ?
Thus to my understanding a mere fact that Address
is shared shouldn't be enough to give it personality (ie identity)?!
Thank you