知识卡片
多接口隔离不同访问角色
同一元素可按逻辑目的和调用者提供多接口,例如公开只读、授权写入、运维监测与调试分别开放。这样按职责与权限暴露所需子集,而不把全部内部资源一次性承诺给所有人。接口越多也越需治理一致性和长期维护,不应仅按每个函数任意拆分。
这张卡片看不懂?
这张卡片的反馈已满 10 条,暂时无法继续提交。
已有反馈 · 0 / 10 条
还没有人提交反馈。
在整书笔记中的位置
原书出处 · 1 处
- 软件接口 · 查看原书依据
Multiple interfaces provide a kind of separation of concerns. A specific class of actor might require only a subset of the functionality available; this functionality can be provided by one of the interfaces. Conversely, the provider of an element may want to grant actors different access rights, such as read or write, or to implement a security policy. Multiple interfaces support different levels of access.
参考来源
- 位置:《Software Architecture in Practice, 4th Edition》第15章《软件接口》(来源项目:book-sources;源文件:extracted/Software Architecture in Practice, 4th Edition/_epub-src/ch15.html)
- 结论依据:所引连续原文给出本卡机制或取舍;条件与示例结合本节已读上下文解释。
- 原始内容:Multiple interfaces provide a kind of separation of concerns. A specific class of actor might require only a subset of the functionality available; this functionality can be provided by one of the interfaces. Conversely, the provider of an element may want to grant actors different access rights, such as read or write, or to implement a security policy. Multiple interfaces support different levels of access.