MIT License

项目介绍

Badacadabra/JavaScript-Design-Patterns 是一个托管在 GitHub 上的开源项目,主要使用 JavaScript 编写,采用 MIT License 许可证,目前获得 311 个 Star、46 次 Fork。

仓库全名
Badacadabra/JavaScript-Design-Patterns
开源许可证
MIT License
Star 数
311
Fork 数
46
未关闭 Issue
1

README 摘要

PatternifyJS - JavaScript Design Patterns About PatternifyJS is a reference of the main design patterns in JavaScript. JS libraries are not covered, but the core scripting languages around JavaScript are there. Here is the list of all available languages: ECMAScript (Vanilla) ES5 ES6 CoffeeScript TypeScript The Gang of Four (GoF) patterns are based on original synopses inspired from the real life and are available…

完整内容见 GitHub 原始 README 或本页 。

常见问题

JavaScript-Design-Patterns 用什么语言开发?

主要使用 JavaScript 编写,采用 MIT License 许可证,目前有 311 个 Star。

JavaScript-Design-Patterns 可以免费商用吗?

仓库采用 MIT License 许可证,可免费使用与修改,商业使用请遵守许可证条款(例如保留版权声明与许可声明)。

如何获取 JavaScript-Design-Patterns 的源码?

可以直接克隆仓库:git clone https://github.com/Badacadabra/JavaScript-Design-Patterns.git,默认分支为 master;安装与运行步骤见仓库 README。

JavaScript-Design-Patterns 最近还在维护吗?

仓库最近一次更新为 2020年10月1日,当前有 1 个未关闭 Issue;Star 数为 311,可作为社区活跃度的参考。

关于

:paperclip: ES5 + ES6 + CoffeeScript + TypeScript design patterns with some theory, real-world examples and UML diagrams

描述取自 GitHub 官方 API,中文内容由 GitRead 中文社区 编辑团队整理。

简要分析

热度分
419
价值分
201
活跃状态
活跃

README

PatternifyJS - JavaScript Design Patterns

About

PatternifyJS is a reference of the main design patterns in JavaScript. JS libraries are not covered, but the core scripting languages around JavaScript are there. Here is the list of all available languages:

  • ECMAScript (Vanilla)
    • ES5
    • ES6
  • CoffeeScript
  • TypeScript

The Gang of Four (GoF) patterns are based on original synopses inspired from the real life and are available in two distinct flavors: “classic” & “idiomatic”.

The classic style emulates the principles of traditional class-based object-oriented languages like Java. Therefore, this style makes heavy use of packages, abstraction, interfaces, classes, inheritance, composition, encapsulation and polymorphism. As a prototype-based language, JavaScript does not have all these functionalities natively (despite all the syntactic sugar introduced by ES6). But it is still possible to use and reproduce most of these concepts… For obvious reasons, constructor functions are the rule in the classic style and each design pattern of this category has its own UML class diagram.

The idiomatic style reveals the true nature of JavaScript. Constructor functions and classes are replaced by factory functions and object literals, there is no abstraction anymore, encapsulation is reduced to the minimum and flexibility raised to the maximum. With this style, the GoF patterns are a bit difficult to recognize because their overall structure is blurred. But here it is more reasonable to think about objects directly, not about classes. This is the reason why class diagrams have been replaced by UML object diagrams in the idiomatic style.

Apart from the GoF patterns, there are also miscellaneous (functional and more) patterns in JavaScript that make life easier. They can be of a great help!

Gang of Four (GoF) patterns

Miscellaneous patterns

Inspiring resources

  • JavaScript: The Definitive Guide by David Flanagan
  • JavaScript: The Good Parts by Douglas Crockford
  • Learning JavaScript Design Patterns by Addy Osmani
  • Exploring ES6 by Axel Rauschmayer
  • The Little Book on CoffeeScript by Alex MacCaw
  • TypeScript Deep Dive by Basarat Ali Syed
  • Design Patterns: Elements of Reusable Object-Oriented Software by Erich Gamma, Richard Helm, Ralph Johnson and John Vlissides

评论

暂无评论