Coder Social home page Coder Social logo

design-pattern-in-javascript's Introduction

JavaScript中的设计模式

设计模式往往是软件设计中的最佳实践,是前人对问题解决的经验总结。很多时候你可能会发现在别人的代码会有一些和自己想法不一样的地方,但为什么不知道为什么要这样写,那么本文将会帮助你更好的理解。同时这也是适合新手和老鸟都适合的文章,对于新手而言可以开放自己的思维,对于老鸟而言在遇到问题的时候翻翻,可能也能获得新的思路。我认为由于JavaScript代码的简洁性,能给人更加容易理解和更直观的感受。

那么现在就开始对JavaScript设计模式的讲解吧。

创建型模式

结构型模式

行为型模式

设计模式的六大原则

  1. 开闭原则(Open Close Principle)
  2. 里氏代换原则(Liskov Substitution Principle)
  3. 依赖倒转原则(Dependence Inversion Principle)
  4. 接口隔离原则(Interface Segregation Principle)
  5. 迪米特法则,又称最少知道原则(Demeter Principle)
  6. 合成复用原则(Composite Reuse Principle)

design-pattern-in-javascript's People

Contributors

zy445566 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.