知识卡片
接口降低对内部表示的依赖
接口规定组件可用操作和数据约定,让使用者不必知道内部实现。改变内部时只要维持契约可减少连锁修改;仍需考虑语义、错误、版本和副作用,不只是列几个方法名。
这张卡片看不懂?
这张卡片已通过人工审查,不再接受失败反馈。
已有反馈 · 0 条
还没有人提交反馈。
在整书笔记中的位置
- · 重构与技术债
原书出处 · 1 处
- · 查看原书依据
Interfaces In the real world, an interface provides a user-friendly way to interact with a complex device (e.g., a microwave oven) without the need to know any implementation details of electromagnetic radiation. Similarly, in the software world, an interface refers to a set of related properties and callable methods that we use to interact with a class. For example, a pandas DataFrame interface includes methods
参考来源
- 位置:《Effective Machine Learning Teams (David Tan, Ada Leung, David Colls)》第08章《重构与技术债》(来源项目:a19c7933-4eda-4176-aebd-30fe7e1ad292;源文件:extracted/Effective Machine Learning Teams (David Tan, Ada Leung, David Colls)/_epub-src/OEBPS/ch08.html)
- 结论依据:摘录中关于接口降低对内部表示的依赖的定义、比较或条件支撑卡片;原书表述不严谨的范围已在覆盖记录逐项限定,不把案例结果外推为普遍结论。
- 原始内容:Interfaces In the real world, an interface provides a user-friendly way to interact with a complex device (e.g., a microwave oven) without the need to know any implementation details of electromagnetic radiation. Similarly, in the software world, an interface refers to a set of related properties and callable methods that we use to interact with a class. For example, a pandas DataFrame interface includes methods