Is uniqueness considered a persistence concern in DDD?
The reason I ask is because I have a Customer
object in an order quoting context. e.g. an order is for a customer and the customer must pay a certain rate.
Technically, I won't allow a customer to have the same code or name as another. Which means if I have two Customer
objects with the same code and name, they'll always be treated the same like a value object.
But instinctively, a Customer
feels like an entity. Is the unique constraint throwing me off, or am I right to think it's a value object?
The order quoting context will also allow customers to be added/edited/removed from an admin page. Could the confusion be caused by this? Should admin pages be part of another context where Customer
is an entity, and the order quoting context will use Customer
as a value object?