mirror of
https://github.com/CyC2018/Interview-Notebook.git
synced 2026-10-30 18:23:52 +00:00
Update 设计模式 - 组合.md
更新代码注释中透明性与单一职责原则的取舍。
This commit is contained in:
+1
-1
@@ -80,7 +80,7 @@ public class Leaf extends Component {
|
||||
|
||||
@Override
|
||||
public void add(Component component) {
|
||||
throw new UnsupportedOperationException(); // 牺牲透明性换取单一职责原则,这样就不用考虑是叶子节点还是组合节点
|
||||
throw new UnsupportedOperationException(); // 牺牲单一职责原则换取透明性,这样就不用考虑是叶子节点还是组合节点
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
Reference in New Issue
Block a user