Update 设计模式 - 组合.md

更新代码注释中透明性与单一职责原则的取舍。
This commit is contained in:
CyC2018
2026-10-28 13:35:21 +08:00
parent c11e96030e
commit 706de9e2bf
+1 -1
View File
@@ -80,7 +80,7 @@ public class Leaf extends Component {
@Override
public void add(Component component) {
throw new UnsupportedOperationException(); // 牺牲透明性换取单一职责原则,这样就不用考虑是叶子节点还是组合节点
throw new UnsupportedOperationException(); // 牺牲单一职责原则换取透明性,这样就不用考虑是叶子节点还是组合节点
}
@Override