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. VB6基本数据库应用(四):数据的提取,新增和修改

    列的第四篇,上一篇在:http://blog.csdn.net/jiluoxingren/article/details/9474661 数据的提取,新增和修改 由于在写第三章的时候没有充分考虑这一章 ...

  2. [C入门 - 游戏编程系列] 贪吃蛇篇(六) - 蛇实现

    这一篇是关于设置蛇的属性的,接上一篇(五). 设置蛇的速度,很简单,只要不是负数就行了. void SNK_SetSnakeSpeed(Snake *snake, int speed) { ) sna ...

  3. sqlserver中临时表、row-number、update更新自己

    SELECT * INTO #TempStudent FROM (SELECT id, ROW_NUMBER() OVER(ORDER BY id) RowNum FROM dbo.student) ...

  4. [TYVJ] P1017 冗余关系

    冗余关系 背景 Background 太原成成中学第3次模拟赛 第4题   描述 Description Mrs.Chen是一个很认真很称职的语文老师 ......所以,当她看到学生作文里的人物关系描 ...

  5. httpcomponents-client-4.3.6 HttpPost的简单使用

    /** * httpcomponents-client-4.3.6 * @author y */ public class HttpUtil { public static String httpPo ...

  6. C51函数的递归调用

    前几天在写C51程序时用到了递归,简单程序如下: void WRITE_ADD(uchar addr,uchar wbyte) { START(); //先发送起始信号 WRITE_BYTE(0xa0 ...

  7. 2013第46周四xml作为WS两端中间测试文件

    今天又到了11点多才开始写随笔记录,有点惭愧,加班回来到现在已经近2小时了,而我此刻才进入正题,之前的时间都跟MM聊天了,或许是单身久了,居然在个人情感方面感觉自己很out了,不想这些了,重点是回顾下 ...

  8. UVa232.Crossword Answers

    题目链接:http://uva.onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&page=show_problem& ...

  9. ofbiz安装优化

    一. 1.安装jdk 2.安装数据库 3.安装ant yum install ant 4.编译启动ofbiz cd /ofbiz目录下 ant run-install ./startofbiz.sh ...

  10. Linux 文件系统同步

    同步就是将物理内存中dirty的页写入到磁盘中,保证磁盘和物理页之间的内容一致. 触发同步操作的时机: 1.周期性内核线程,扫描脏页,根据一定的规则选择脏页,将页写回到磁盘. 2.如果内核中的脏页过多 ...