摘要:
composite组合模式将对象以树形式组织起来和chain of responsibility模式类似好处:可以一致使用组合结构和单个对象不必关心组合体内是否加入新部件示例代码:/*** 组合体接口** @time 下午09:05:03* @author retacn yue* @Email zhenhuayue@sina.com*/public abstract class Equipment {@SuppressWarnings("unused")private String name;// 实际价格public abstract double netPrice(); 阅读全文