知识卡片

普通读书笔记卡 · 1971.o.6.c.1 · 生成模型:GPT-6

附属对象的独立身份

理解等级:高级

如果消费者只在工作中创建和读取狗的说明,可以把描述当作 Job 的一部分。现实中的同一只狗在多个工作中会有多个描述实例。需要跨工作维护同一只狗时才有理由给它独立身份和生命周期。

这张卡片看不懂?

已有反馈 · 0 条

    还没有人提交反馈。

    在整书笔记中的位置

    原书出处 · 1 处

    参考来源

    - 位置:《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,阅读块 204) - 结论依据:原文因 Dog 随 Job 创建并一一对应而省略 Dog ID。 - 原始内容:What about relationships? Well, due to the inclusion of the dog in every job posting, there is a strong connection between the Dog and Job models. It is a one-to-one mapping, which means that for every job there is exactly one dog,