DDD - Should individuals have equal comparisons

Eric Evans in a multiple viewing video says: "I came to the conclusion that an entity should not even compare equality."

Will this mean that the object should not have the required Id field (as its infrastructure is concerned). When is entity matching required? As he mentions, in most cases this may not be necessary.

[Edit] When I mentioned that it doesn’t require Id, it was wrt to create an ie object, I can only check my logic with a new object (order = new Order) without passing a Guid or Id. There would be an identifier for saving, ideally generated by db.

+4
source share
2 answers

, Entity ID; , , Entity .

. (Presentation, Application Infrastructure), Entity, . Entity Entities.

. , , Entity, .

UPDATE: , , , ( ), , , - , ? , - -, . , .

+1

, , - , / , . , , .

/ / - , , , ?

"", , , /, , , . , / ? , . "-", , / .

, , mot , , . Id , .

0
source

Source: https://habr.com/ru/post/1692562/


All Articles