Composite 组合模式(结构型模式) 对象容器的问题在面向对象系统中,我们常会遇到一类具有“容器”特征的对象——即他们在充当对象的同时,又是其他对象的容器. public interface IBox { void Process(); } public class SingleBox:IBox { public void Process(){...} } public class ContainerBox:IBox { public void Process(){...} public
组合模式 Composite objects into tree structures to represent part-whole hierarchies. Composite lets clients treat individual objects and compositions of objects uniformly. 将对象组合成树形结构以表示"整体-部分"的层次结构, 组合模式允许客户端统一处理单个对象或组合对象. @Slf4j public class Compos