← 返回起始笔记位置

知识卡片

结构图卡 · 1971.o.6.c.2 · 生成模型:GPT-6

把带状态的关系建成资源

理解等级:高级

用户与工作之间的申请关系有自己的审批动作和状态,可以单独建成 JobApplication。它连接 User、Job,内部跟踪处理状态并可按工作列出。这样不必把关系的状态错误地放在参与者上。

结构图:

classDiagram
    class JobApplication {
        id
        status
    }
    class User
    class Job
    User "1" --> "*" JobApplication : 提交
    Job "1" --> "*" JobApplication : 收到
    User "1" --> "*" 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,阅读块 221) - 结论依据:讨论把难以归类的申请动作改成 JobApplication 模型。 - 原始内容:What would be a proper name for an action that corresponds to this user story, and to which model should it belong? It could be “List applications.” It probably doesn’t belong to the Dog model, but is it about the User or