随笔分类 - 设计模式
摘要:Provide an interface for creating families of related or dependent objects without specifying their concrete classes.(为创建一组相关或相互依赖的对象提供一个接口,而且无须指定它们的具
阅读全文
摘要:组合模式(Composite Pattern)也叫合成模式,有时又叫做部分-整体模式(Part-Whole),主要是用来描述部分与整体的关系: 定义: Compose objects into tree structures to represent part-whole hierarchies.C
阅读全文
摘要:Attach additional responsibilities to an object dynamically keeping the same interface.Decorators provide a flexible alternative to subclassing for ex
阅读全文
摘要:Avoid coupling the sender of a request to its receiver by giving more than one object a chance to handle the request.Chain the receiving objects and p
阅读全文
摘要:怎么把策略模式和工厂模式结合起来使用 怎么把策略模式和工厂模式结合起来使用 如果大家对策略模式和工厂模式不是很了解的话可以先看前面文章策略模式:https://www.jianshu.com/p/958281936901工厂模式:https://www.jianshu.com/p/9078481e0
阅读全文

浙公网安备 33010602011771号