知识卡片
身份键独立于邮箱
账号可以用邮箱查找,但关系最好引用独立稳定 ID。更换联系方式无需迁移工作、订单等引用。唯一性、账户查找与持久标识应分别设计。
这张卡片看不懂?
这张卡片已通过人工审查,不再接受失败反馈。
已有反馈 · 0 条
还没有人提交反馈。
在整书笔记中的位置
原书出处 · 1 处
- Designing a web application 9.4 A domain model for PetSitter · 查看原书依据
From her perspective as a backend developer, Nidhi makes another suggestion: “An email address can change, but a user’s identifier shouldn’t have to. We could add an ID attribute.” The team agrees and adds “ID” to their list. Figure 9.8 shows the
参考来源
- 位置:《Designing APIs with Swagger and OpenAPI》第09章《Designing a web application》(来源项目 book-source:extracted/Designing APIs with Swagger and OpenAPI/_epub-src/OEBPS/Text/ch09.htm,阅读块 113)
- 结论依据:团队考虑邮箱会变,因此为 User 附加稳定 ID。
- 原始内容:From her perspective as a backend developer, Nidhi makes another suggestion: “An email address can change, but a user’s identifier shouldn’t have to. We could add an ID attribute.” The team agrees and adds “ID” to their list. Figure 9.8 shows the