Chinaunix首页 | 论坛 | 博客
  • 博客访问: 2558604
  • 博文数量: 351
  • 博客积分: 76
  • 博客等级: 上将
  • 技术积分: 3555
  • 用 户 组: 普通用户
  • 注册时间: 2004-11-13 21:27
文章分类

全部博文(351)

文章存档

2013年(1)

2012年(4)

2011年(7)

2010年(16)

2009年(34)

2008年(34)

2007年(34)

2006年(68)

2005年(82)

2004年(71)

分类: 项目管理

2005-01-06 16:15:57

为什么要学习设计模式(Design Patterns) - 软件设计大师之路

知识的模式(Patterns of Learning)

在人类努力解决的许多领域的成功方案都来源于各种模式(Patterns).

事实上, 教育的一个重要目标就是把知识的模式一代一代传下去.

下面我们首先看一下学习下棋是怎样用到模式(patterns).
学习开发一个好的程序类似于学习怎样下好棋.

成为一个象棋大师
* 首先学习规则和必要条件
  例如, 棋子的名称, 合法的棋子移动, 棋盘的几何形状和方向等
* 然后学习原理
  例如某一种棋子的相对价值, 中心格的战略价值, 威胁的强度等
* 然而要成为象棋大师, 你必须要学习其他大师下过的棋局
  这些棋局就包含有模式(patterns),这些模式(patterns)必须被理解,记忆和重复的运用
* 有很多种这样的模式(patterns)

成为一个软件设计大师
* 首先学习规则
  例如算法, 数据结构和软件语言
* 然后学习原理
  例如结构化编程, 模块化编程, 面向对象编程, 泛编程(general programming)等
* 但是要真正的精通软件设计, 你必须学习其他大师级的设计
  这些设计包含的模式(patterns)必须被理解,记忆和重复的运用
* 有很多种这样的模式(patterns)

翻译水平有限,以下附上原文:

Patterns of Learning

Successful solutions to many areas of human endeavor are deeply rooted in patterns
In fact, an important goal of education is transmitting patterns of learning
from generation to generation
  Below, we'll explore how patterns are used to learn chess
  Learning to develop good software is similar to learning to play good chess

Becoming a Chess Master

1) First learn rules and physical requirements
  e.g., names of pieces, legal movements, chess board geometry and orientation, etc. 2) Then learn principles
  e.g., relative value of certain pieces, strategic value of center squares, power of a threat, etc.
3) However, to become a master of chess, one must study the games of other masters
  These games contain patterns that must be understood, memorized, and applied repeatedly
4) There are hundreds of these patterns

Becoming a Software Design Master

First learn the rules
e.g., the algorithms, data structures and languages of software

Then learn the principles
e.g., structured programming, modular programming, object oriented programming, generic programming, etc.

However, to truly master software design,one must study the designs of other masters
These designs contain patterns must be understood, memorized, and applied repeatedly

There are hundreds of these patterns

阅读(2180) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~