Design patterns vary in their granularity and level of abstraction. Because thereare many design patterns, weneed a way to organize them. This section classifies design patterns so that we can refer tofamilies of related patterns. The

classification helps you learn the patternsin the catalog faster, and it can direct efforts to find new patterns aswell.

在抽象的粒度和和水平上,设计模式是多样化。由于有很多的设计模式,我们需要一种组织它们的方法。本节将设计模式分类,以至于我们可以更多地了解哪些相关联的设计模式。这种分类可以帮助你更快的学习这些设计模式。这也对你发现新的设计模式有影响。

We classify design patterns by two criteria(Table 1.1). The first criterion, called purpose, reflects what a patterndoes. Patterns can have either creational,structural, or behavioral purpose.Creational patterns concern the process of

object creation. Structural patterns dealwith the composition of classes or objects. Behavioral patterns characterizethe ways in which classes or objects interact and distribute responsibility.

通过表1.1这两个标准, 我们将设计模式进行分类。第一个标准是目的,反映的是设计模式。模式可以有创造(造物)或结构或行为目的。创造模式关心的是对象创建的进程。结构处理的是类和对象的组成。行为模式的特征是类和对象的相互影响和分类。

The second criterion, called scope,specifies详述,特性 whetherthe pattern applies primarily to classes or to objects. Classpatterns deal with relationships between classes and their subclasses. Theserelationships are established through

inheritance, so they are static—fixed atcompile-time. Object patterns deal with object relationships, which can be changedat run-time and are more dynamic. Almost all patterns use inheritance to someextent. So the only patterns labeled "class

patterns" are those that focus onclass relationships. Note that most patterns are in the Object scope.

第二个标准是规模。提出模式是否应用于类和对象的条件。类模式处理类和子类之间的关系。这些关系已经在继承时确立,因此它是静态固定的编译。对象模式处理对象之间的关系。在执行时它可以被改变,它更多体现动态。在一定程度上,几乎所有的模式都用继承。因此只有“类模式”关注的是类之间的关系。注意更多地模式关注的是对象的规模。

Creational class patterns defer some partof object creation to subclasses, while Creational object patterns defer it toanother object. The Structural class patterns use inheritance to composeclasses, while the Structural object patterns describe ways to assemble objects. TheBehavioral class patterns use inheritance to describe algorithms and flow of control,whereas the Behavioral object patterns

describe how a group of objects cooperateto perform a task that no single object can carry out alone.

创新类模式遵从部分对象到子类,创新对象模式遵从对象到其他的对象。结构类模式用继承来组成类,结构对象描述了组合对象的方法。行为类模式用继承来描述算法和流程控制。在这里行为类模式描述了一组对象合作完成任务,而不是单个对象可以独自执行可完成的。

There are other ways to organize thepatterns. Some patterns are often used together.For example, Composite is often used withIterator or Visitor. Some patterns are alternatives: Prototype is often analternative to Abstract Factory. Some patterns result in similar designs even though thepatterns have different intents. For example, the structure diagrams ofComposite and Decorator are similar.

也有一些其他的方法来组织模式。一些模式经常用在一起。例如,经常将迭代器模式和访问者模式结合在一起用。样板经常继承于抽象工厂模式。即使模式有不同的意图,一些设计却拥有类似的设计。例如,结构图的复合和装饰是相似的。

Yet another way to organize design patternsis according to how they reference each other in their "RelatedPatterns" sections. Figure 1.1 depicts these relationships graphically.

现在,其他的方法来组织设计模式是根据每个相关模式部分是如何引用的。图1.1生动的描述了这种关系。

Clearly there are many ways to organizedesign patterns. Having multiple ways of thinking about patterns will deepen yourinsight into what they do, how theycompare, and when to apply them.

准确的说有很多的方法来组织设计模式。有多个方法思考设计模式会加深你洞察它们是做什么的,会洞察它们是如何被比较,以及在什么时间应用它们。

设计模式 之 Organizing the Catalog 组织目录的更多相关文章

  1. RMAN-使用catalog恢复目录进行备份与恢复

    RMAN ArchitectureThe RMAN architecture, shown in Figure 7-3, includes a target database, repository, ...

  2. Oracle之catalog恢复目录的创建于维护(51CTO风哥rman课程)

    catalog恢复目录配置过程 1,创建一个表空间 2,创建rman用户并授权 3,创建恢复目录 4,配置TNS 5,注册数据库 6,检查 创建ramn表空间 首先查看一下其他表空间位置 create ...

  3. splunk的bucket组织目录——时间序列,按照时间来组织目录

    splunk的bucket组织目录:db_1481515116_1480695302_0db_1481537316_1481532688_1db_1481547598_1481539988_2db_1 ...

  4. RMAN_学习笔记3_RMAN Catalog恢复目录

    2014-12-23 Created By BaoXinjian

  5. Unity 多个Android sdk 插件如何组织目录

    一般Android 插件放在 Assets/Plugins/Android/ 下, 但是一个项目可能要用到多个sdk , 比如既要用 阿里九游的sdk 又要用 share sdk 怎么办呢, 难道要只 ...

  6. Facebook币Libra学习-5.Move组织目录

    Move是一种新的编程语言,旨在为Libra Blockchain提供安全可编程的基础. 组织 Move语言目录由五部分组成: 的虚拟机(VM),其中包含的字节码格式,字节码解释器,和基础设施执行事务 ...

  7. 20 Organizing Go code 组织go代码

    Organizing Go code 16 August 2012 Introduction Go code is organized differently to that of other lan ...

  8. python 设计模式专题(一):目录篇

    一.创建型设计模式 1.工厂模式 2.建造者模式 3.原型模式 二.结构型设计模式(组合) 1.适配器模式 2.装饰器模式 3.外观模式 4.单例模式 5.mvc模式 6.代理模式 三.行为型设计模式 ...

  9. rman catalog (rman 恢复目录)

    受控制文件大小的限制,一般rman需要用rman catalog来管理及存放备份信息: 这里介绍一下创建rman catalog的步骤: C:\Documents andSettings\Admini ...

随机推荐

  1. Nutch的日志系统

    一.Nutch日志实现方式 1.Nutch使用slf4j作为日志接口,使用log4j作为具体实现.关于二者的基础,请参考 http://blog.csdn.net/jediael_lu/article ...

  2. python爬虫下载youtube单个视频

    __author__ = 'Sentinel'import requestsimport reimport jsonimport sysimport shutilimport urlparse &qu ...

  3. C语言递归分析

    思路 下图描述的是从问题引出到问题变异的思维过程: 概述 本文以数制转换为引,对递归进行分析.主要是从多角度分析递归过程及讨论递归特点和用法. 引子 一次在完成某个程序时,突然想要实现任意进制数相互转 ...

  4. AsEnumrable和AsQueryable的区别

    http://www.cnblogs.com/jianglan/archive/2011/08/11/2135023.html 在写LINQ语句的时候,往往会看到.AsEnumerable() 和 . ...

  5. QDataStream类参考(串行化数据,可设置低位高位,以及版本号),还有一个例子

    QDataStream类提供了二进制数据到QIODevice的串行化. #include 所 有成员函数的列表. 公有成员 QDataStream () QDataStream ( QIODevice ...

  6. 【转】将 Linux 应用程序移植到 64 位系统上

    原文网址:http://www.ibm.com/developerworks/cn/linux/l-port64.html 随着 64 位体系结构的普及,针对 64 位系统准备好您的 Linux® 软 ...

  7. linux find命令-print0和xargs中-0使用技巧(转载)

    本文介绍了linux find命令中-print0和xargs中-0用法技巧,一些find命令的使用经验,需要的朋友参考下. 本节内容:linux find命令中-print0和xargs中-0的用法 ...

  8. springmvc工作原理和环境搭建

    SpringMVC工作原理     上面的是springMVC的工作原理图: 1.客户端发出一个http请求给web服务器,web服务器对http请求进行解析,如果匹配DispatcherServle ...

  9. (史上最全的ios源码汇总)

    按钮类         按钮 Drop Down Control         http://www.apkbus.com/android-106661-1-1.html 按钮-Circular M ...

  10. unity3d 建树篇

    今天碰到有人问这个问题,然后我经过一番折腾,找到了方法.例如以下: 有学过Unity3d的同学生都知道我们在对地形拖拉树木等表层时,其树木在我们实例执行中,它们都是能够任其他物体穿过. 这是为什么.相 ...