随笔分类 -  设计模式

摘要:Provide an interface for creating families of related or dependent objects without specifying their concrete classes.(为创建一组相关或相互依赖的对象提供一个接口,而且无须指定它们的具 阅读全文
posted @ 2019-07-08 22:55 爱在惜缘前 阅读(130) 评论(0) 推荐(0)
摘要:组合模式(Composite Pattern)也叫合成模式,有时又叫做部分-整体模式(Part-Whole),主要是用来描述部分与整体的关系: 定义: Compose objects into tree structures to represent part-whole hierarchies.C 阅读全文
posted @ 2019-06-19 21:41 爱在惜缘前 阅读(141) 评论(0) 推荐(0)
摘要:Attach additional responsibilities to an object dynamically keeping the same interface.Decorators provide a flexible alternative to subclassing for ex 阅读全文
posted @ 2019-06-13 23:54 爱在惜缘前 阅读(469) 评论(0) 推荐(0)
摘要: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 阅读全文
posted @ 2019-06-12 21:25 爱在惜缘前 阅读(165) 评论(0) 推荐(0)
摘要:怎么把策略模式和工厂模式结合起来使用 怎么把策略模式和工厂模式结合起来使用 如果大家对策略模式和工厂模式不是很了解的话可以先看前面文章策略模式:https://www.jianshu.com/p/958281936901工厂模式:https://www.jianshu.com/p/9078481e0 阅读全文
posted @ 2019-06-01 14:50 爱在惜缘前 阅读(1775) 评论(0) 推荐(0)