GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — javascript/JavaScript-Design-Patterns at master · wchaowu/javascript

Expand file tree

/

JavaScript-Design-Patterns

/
Copy path

Directory actions

More options

More options

Directory actions

More options

More options

Latest commit

 

History

History
History
/

JavaScript-Design-Patterns

/
Copy path

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
Chaining
Chaining
 
 
State-Pattern
State-Pattern
 
 
The-Adapter-Pattern
The-Adapter-Pattern
 
 
The-Bridge-Pattern
The-Bridge-Pattern
 
 
The-Chain-of-Responsibility-Pattern
The-Chain-of-Responsibility-Pattern
 
 
The-Command-Pattern
The-Command-Pattern
 
 
The-Composite-Pattern
The-Composite-Pattern
 
 
The-Decorator-Pattern
The-Decorator-Pattern
 
 
The-Facade-Pattern
The-Facade-Pattern
 
 
The-Factory-Pattern
The-Factory-Pattern
 
 
The-Flyweight-Pattern
The-Flyweight-Pattern
 
 
The-Observer-Pattern
The-Observer-Pattern
 
 
The-Proxy-Pattern
The-Proxy-Pattern
 
 
The-Singleton-Pattern
The-Singleton-Pattern
 
 
README.md
README.md
 
 

README.md

设计模式

对“模式”的广义解释是“反复发生的事件或对象的固定用法...可以用来作为重复使用的模板或模型”(http://en.wikipedia.org/wiki/Pattern)。
在软件开发领域,模式是指常见问题的通用解决方案。模式不是简单的代码复制和粘贴,而是一种最佳实践,一种高级抽象,是解决某一类问题的范本。
学习这些模式非常重要,因为:
> > 这些模式提供了经过论证的最佳实践,它可以帮助我们更好的编码,避免重复造轮子。 > > 这些模式提供了高一层的抽象。一个时间段内大脑只能处理一定复杂度的逻辑,因此当你处理更繁琐棘手的问题时,使用模式可以帮你理清头绪,不会被低级的琐事阻碍大脑思考, 因为所有的细枝末节都可以被归类和切分成不同的块(模式)。 这些模式为开发者和团队提供了沟通的渠道,团队开发者之间往往是异地协作,不会有经常面对面的沟通机会。简单的代码编写技巧和技术问题处理方式的约定(代码注释) 可以使开发者之间的交流更加通畅。例如,说“即时函数”(immediate function)比说“你写好一个函数后,在函数的结束花括号的后面添加一对括号, 这样能在定义函数结束后马上执行这个函数”要更容易表达和理解。
《parctical common lisp》的作者曾说,如果你需要一种模式,那一定是哪里出了问题。他所说的问题是指因为语言的天生缺陷,不得不去寻求和总结一种通用的解决方案。
不管是弱类型或强类型,静态或动态语言,命令式或说明式语言、每种语言都有天生的优缺点。一个牙买加运动员, 在短跑甚至拳击方面有一些优势,在练瑜伽上就欠缺一些。
术士和暗影牧师很容易成为一个出色的辅助,而一个背着梅肯满地图飞的敌法就会略显尴尬。

###反模式
You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.