开发者

Value Objects Vs Entities

开发者 https://www.devze.com 2023-01-05 13:16 出处:网络
Quick question... When approaching something like an email address the immediate idea is to treat this as a value object.

Quick question... When approaching something like an email address the immediate idea is to treat this as a value object.

If we have a number of entities though, say a customer, a contact, and a supplier that are referencing the same email address, it is conceivable that when we change a customer's email address we may want the customer's contact, and they may be a supplier too, have that email change reflected with those entities as well. Am I correct in thinking this is giving the email address identity so it should now be represented as an entity?开发者_如何学Python

Cheers,

Steve


Yes, I believe you're on the right lines. See my previous answer here.

0

精彩评论

暂无评论...
验证码 换一张
取 消