← 返回起始笔记位置

知识卡片

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

超类型只放真正共性

理解等级:高级

选择超类型的属性时核对其约束、语义和预期演进。名字与年龄可供各宠物共享,品种未来可能由不同分类系统管理。把表面同名的属性提早锁在基类会限制各子类的独立表达。

这张卡片看不懂?

已有反馈 · 0 条

    还没有人提交反馈。

    在整书笔记中的位置

    原书出处 · 1 处

    参考来源

    - 位置:《Designing APIs with Swagger and OpenAPI》第16章《Designing schemas with composition in OpenAPI》(来源项目 book-source:extracted/Designing APIs with Swagger and OpenAPI/_epub-src/OEBPS/Text/ch16.htm,阅读块 54) - 结论依据:原文以将来不同的 breed 表示说明字段同名仍不宜合并。 - 原始内容:Why didn’t we make the breed a common attribute? Well, while these attributes have the same name, we already mentioned that we may represent them differently in the system later on. Also, there’s always a chance that we’ll add a type of