07 2017 档案
摘要:1、定义 1.1 标准定义 适配器模式(AdapterPattern)的定义如下: Convert the interface of a class into another interface clients expect.Adapter lets classes work together th
阅读全文
摘要:1、定义 1.1标准定义 策略模式(StrategyPattern)是一种比较简单的模式,也叫做政策模式(PolicyPattern)。其定义如下: Define a family of algorithms,encapsulate each one,and make them interchang
阅读全文
摘要:1、定义 1.1 标准定义 装饰模式(Decorator Pattern)是一种比较常见的模式,其定义如下: Attach additional responsibilities to an object dynamically keeping the same interface.Decorato
阅读全文
摘要:1、定义 1.1 标准定义 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
阅读全文
摘要:1、 定义 1.1 标准定义 命令模式是一个高内聚的模式,其定义为: Encapsulate a request as an object,therebyletting you parameterize clients with different requests,queue or log req
阅读全文
摘要:1、 定义 1.1 标准定义 中介者模式的定义为:Define an object that encapsulates how a set of objectsinteract.Mediator promotes loose coupling by keeping objects from refe
阅读全文
摘要:1、 定义 1.1 标准定义 原型模式( Prototype Pattern) 的简单程度仅次于单例模式和迭代器模式。 正是由于简单, 使用的场景才非常地多, 其定义如下: Specify the kinds of objects to create using a prototypical ins
阅读全文
摘要:1、定义 1.1 标准定义 Provide a surrogate or placeholder for another object to control access to it.( 为其他对象提供一种代理以控制对这个对象的访问。 ) 1.2 通用类图 代理模式也叫做委托模式, 它是一项基本设计
阅读全文
摘要:1、定义 1.1 标准定义 建造者模式( Builder Pattern) 也叫做生成器模式, 其定义如下: Separate the construction of a complex object from its representation so that the same construc
阅读全文
摘要:1、定义 1.1 标准定义 Define the skeleton of an algorithm in an operation,deferring some steps to subclasses.TemplateMethod lets subclasses redefine certain s
阅读全文
摘要:1、工厂模式概述 工厂方法模式使用的频率非常高, 在我们日常的开发中总能见到它的身影。 工厂方法解决的问题是可以让你轻松方便的构造对象实例,而不必不必关心构造对象实例的细节和复杂过程。 在我们日常生活中经常遇到的有三种工厂模式:简单工厂模式,工厂模式,抽象工厂模式。 2、简单工厂模式 2.1 应用
阅读全文
摘要:1、单例模式的定义 单例模式( Singleton Pattern) 是一个比较简单的模式, 其定义如下: Ensure a class has only one instance, and provide a global point of access to it.( 确保某一个类只有一个实例,
阅读全文