知识卡片
把带状态的关系建成资源
用户与工作之间的申请关系有自己的审批动作和状态,可以单独建成 JobApplication。它连接 User、Job,内部跟踪处理状态并可按工作列出。这样不必把关系的状态错误地放在参与者上。
结构图:
classDiagram
class JobApplication {
id
status
}
class User
class Job
User "1" --> "*" JobApplication : 提交
Job "1" --> "*" JobApplication : 收到
User "1" --> "*" Job : 发布
这张卡片看不懂?
这张卡片已通过人工审查,不再接受失败反馈。
已有反馈 · 0 条
还没有人提交反馈。
在整书笔记中的位置
原书出处 · 1 处
- Designing a web application 9.5 User stories for PetSitter · 查看原书依据
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
参考来源
- 位置:《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