Skip to content

Commit 66e6534

Browse files
committed
Composite pattern
1 parent 8753c12 commit 66e6534

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

README.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,10 @@
5454

5555
> [组合模式(Composite Pattern)](/Example/Composite-Pattern.js)
5656
57+
定义:又叫部分整体模式,是用于把一组相似的对象当作一个单一的对象。
58+
目的:将对象组合成树形结构以表示"部分-整体"的层次结构。
59+
场景:您想表示对象的部分-整体层次结构(树形结构)。
60+
5761
> [装饰模式(Decorator Pattern)](/Example/Decorator-Pattern.js)
5862
5963
定义:在不改变原对象的情况下,动态的给对象添加一些额外的职责。就功能而言,装饰模式相比生成子类更为灵活。

0 commit comments

Comments
 (0)