Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/zy445566/design-pattern-in-javascript
Design pattern In JavaScript(JavaScript的设计模式)
https://github.com/zy445566/design-pattern-in-javascript
design-patterns javascript nodejs
Last synced: 5 days ago
JSON representation
Design pattern In JavaScript(JavaScript的设计模式)
- Host: GitHub
- URL: https://github.com/zy445566/design-pattern-in-javascript
- Owner: zy445566
- License: mit
- Created: 2019-11-18T03:14:15.000Z (almost 5 years ago)
- Default Branch: master
- Last Pushed: 2021-02-08T12:11:39.000Z (almost 4 years ago)
- Last Synced: 2023-02-27T03:02:08.753Z (over 1 year ago)
- Topics: design-patterns, javascript, nodejs
- Language: JavaScript
- Homepage:
- Size: 132 KB
- Stars: 71
- Watchers: 5
- Forks: 15
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# JavaScript中的设计模式
设计模式往往是软件设计中的最佳实践,是前人对问题解决的经验总结。很多时候你可能会发现在别人的代码会有一些和自己想法不一样的地方,但为什么不知道为什么要这样写,那么本文将会帮助你更好的理解。同时这也是适合新手和老鸟都适合的文章,对于新手而言可以开放自己的思维,对于老鸟而言在遇到问题的时候翻翻,可能也能获得新的思路。我认为由于JavaScript代码的简洁性,能给人更加容易理解和更直观的感受。那么现在就开始对JavaScript设计模式的讲解吧。
# 创建型模式
* [工厂模式](./design-pattern/factory-pattern/README.md)
* [抽象工厂模式](./design-pattern/abstract-factory-pattern/README.md)
* [单例模式](./design-pattern/singleton-pattern/README.md)
* [建造者模式](./design-pattern/builder-pattern/README.md)
* [原型模式](./design-pattern/prototype-pattern/README.md)# 结构型模式
* [适配器模式](./design-pattern/adapter-pattern/README.md)
* [桥接模式](./design-pattern/bridge-pattern/README.md)
* [过滤器模式](./design-pattern/filter-pattern/README.md)
* [组合模式](./design-pattern/composite-pattern/README.md)
* [装饰器模式](./design-pattern/decorator-pattern/README.md)
* [外观模式](./design-pattern/facade-pattern/README.md)
* [享元模式](./design-pattern/flyweight-pattern/README.md)
* [代理模式](./design-pattern/proxy-pattern/README.md)# 行为型模式
* [责任链模式](./design-pattern/chain-of-responsibility-pattern/README.md)
* [命令模式](./design-pattern/command-pattern/README.md)
* [解释器模式](./design-pattern/interpreter-pattern/README.md)
* [迭代器模式](./design-pattern/iterator-pattern/README.md)
* [中介者模式](./design-pattern/mediator-pattern/README.md)
* [备忘录模式](./design-pattern/memento-pattern/README.md)
* [观察者模式](./design-pattern/observer-pattern/README.md)
* [状态模式](./design-pattern/state-pattern/README.md)
* [空对象模式](./design-pattern/null-object-pattern/README.md)
* [策略模式](./design-pattern/strategy-pattern/README.md)
* [模板模式](./design-pattern/template-pattern/README.md)
* [访问者模式](./design-pattern/visitor-pattern/README.md)# 设计模式的六大原则
1. 开闭原则(Open Close Principle)
2. 里氏代换原则(Liskov Substitution Principle)
3. 依赖倒转原则(Dependence Inversion Principle)
4. 接口隔离原则(Interface Segregation Principle)
5. 迪米特法则,又称最少知道原则(Demeter Principle)
6. 合成复用原则(Composite Reuse Principle)