← 返回刚才阅读的位置

知识卡片

普通读书笔记卡 · 1971.o.1.b.4.d.1.c.1.a.8

实体身份跨越状态

理解等级:中级

实体依靠明确且生命周期内稳定的标识来保持身份;两人同名仍是两个实体,一个人改名仍是同一个人。值对象则按值判断相等。标识本身可以是值对象。此处的领域模型将实体置于聚合内部,让身份、状态变化与一致性边界共同设计。

这张卡片看不懂?

已有反馈 · 0 条

    还没有人提交反馈。

    在整书笔记中的位置

    原书出处 · 1 处

    • 应对复杂业务逻辑 · 查看原书依据

      An entity is the opposite of a value object. It requires an explicit identification field to distinguish between the different instances of the entity. A trivial example of an entity is a person. Consider the following class: class Person { public Name Name { get; set; } public Person(Name name) { this.Name = name; }

    参考来源

    - 位置:《Learning Domain-Driven Design》第6章《应对复杂业务逻辑》(来源项目:book-sources;源文件:extracted/Learning Domain-Driven Design/_epub-src/OEBPS/ch06.html) - 结论依据:原文围绕本卡所述机制给出定义、适用条件及相关取舍,以下摘录为直接依据。 - 原始内容:An entity is the opposite of a value object. It requires an explicit identification field to distinguish between the different instances of the entity. A trivial example of an entity is a person. Consider the following class: class Person { public Name Name { get; set; } public Person(Name name) { this.Name = name; }