将对象组合成树形结构以表示“部分–整体”的层次结构。
组合模式使得用户对单个对象和组合独享的使用具有一致性。
组合模式UML
一、使用步骤
二、基本属性
三、代码示例
1.树形结构
https://github.com/shileseal/SLBinaryTreeDemo
2.组合模式
https://github.com/shileseal/SLCompositeDemo
3.编写文件夹系统
https://github.com/shileseal/SLFileSystemDemo