上一页 1 ··· 3 4 5 6 7 8 9 10 11 ··· 13 下一页
摘要: 1.蜡笔与毛笔的故事(引用自http://www.cnblogs.com/zhenyulu/articles/67016.html)我想大家小时候都有用蜡笔画画的经历吧。红红绿绿的蜡笔一大盒,根据想象描绘出各式图样。而毛笔下的国画更是工笔写意,各展风采。而今天我们的故事从蜡笔与毛笔说起。设想要绘制一... 阅读全文
posted @ 2015-07-01 17:54 JustYong 阅读(267) 评论(0) 推荐(0)
摘要: 1.定义Convert the interface of a class into another interface clients expect.Adapter lets classes work together that couldn't otherwise becasue of incom... 阅读全文
posted @ 2015-07-01 14:57 JustYong 阅读(402) 评论(0) 推荐(0)
摘要: 1.定义Seperate the construction of a complex object from its representation so that the same construction process can create different representations.(... 阅读全文
posted @ 2015-07-01 11:17 JustYong 阅读(418) 评论(0) 推荐(0)
摘要: 1.定义Provide an interface for creating families of related or dependent objects without specifying their concrete classes.(为创建一组相关或相互依赖的对象提供一个接口,而且无须指定... 阅读全文
posted @ 2015-07-01 10:01 JustYong 阅读(238) 评论(0) 推荐(0)
摘要: 1.定义Define an interface for creating an object,but let subclasses decide which class to instantiate.Factory method let a class defer instantiation to ... 阅读全文
posted @ 2015-06-29 23:25 JustYong 阅读(421) 评论(0) 推荐(0)
摘要: 1.定义Ensure a class has only one instance,and provide a global point of access to it.(确保某一个类只有一个实例,而且自行实例化并向整个系统提供这个实例。)2.模式讲解(1)类图(2)单例模式通用代码 1 public... 阅读全文
posted @ 2015-06-23 23:08 JustYong 阅读(250) 评论(0) 推荐(0)
摘要: 1.定义Provide a surrogate(代理) or placeholder for another object to control access to it(为其他对象提供一种代理以控制对这个对象的访问)2.模式说明.Subject抽象主题角色抽象主题类可以是抽象类也可以是接口,是一个... 阅读全文
posted @ 2015-06-19 17:30 JustYong 阅读(146) 评论(0) 推荐(0)
摘要: 1.定义Define a family of algorithms,encapsulate each one,and make them interchangeable.(定义一组算法,将每个算法都封装起来,并且使它们之间可以互换)2.模式说明Context:封装角色屏蔽高层模块对策略、算法的直接访... 阅读全文
posted @ 2015-06-19 15:59 JustYong 阅读(244) 评论(0) 推荐(0)
摘要: 1.定义Attach additonal responsibilities to an object dynamically keeping the same interface,Decorators provide a flexible alternative to subclassing for... 阅读全文
posted @ 2015-06-19 14:42 JustYong 阅读(363) 评论(0) 推荐(0)
摘要: 1.定义使多个对象都有机会处理请求,从而避免了请求的发送者和接受者之间的耦合关系,将这些对象连成一条链,并沿着这条链传递该请求,直到有对象处理它为止。责任链模式的重点是在"链"上,由一条链去处理相似的请求在链中决定谁来处理这个请求,并返回相应的结果。2.代码实现 public abstract... 阅读全文
posted @ 2015-06-19 11:37 JustYong 阅读(374) 评论(0) 推荐(0)
上一页 1 ··· 3 4 5 6 7 8 9 10 11 ··· 13 下一页