- JavaScript:Moving to ES2015
- Ved Antani Simon Timms Narayan Prusty
- 272字
- 2021-07-09 19:07:37
Chapter 5. JavaScript Patterns
So far, we have looked at several fundamental building blocks necessary to write code in JavaScript. Once you start building larger systems using these fundamental constructs, you soon realize that there can be a standard way of doing a few things. While developing a large system, you will encounter repetitive problems; a pattern intends to provide a standardized solution to such known and identified problems. A pattern can be seen as a best practice, useful abstraction, or template to solve common problems. Writing maintainable code is difficult. The key to write modular, correct, and maintainable code is the ability to understand the repeating themes and use common templates to write optimized solutions to these. The most important text on design patterns was a book published in 1995 called Design Patterns: Elements Of Reusable Object-Oriented Software written by Erich Gamma, Richard Helm, Ralph Johnson, and John Vlissides—a group that became known as the Gang of Four (GOF for short). This seminal work gave a formal definition to various patterns and explained implementation details of most of the popular patterns that we use today. It is important to understand why patterns are important:
- Patterns offer proven solutions to common problems: Patterns provide templates that are optimized to solve a particular problem. These patterns are backed by solid engineering experience and tested for validity.
- Patterns are designed to be reused: They are generic enough to fit variations of a problem.
- Patterns define vocabulary: Patterns are well-defined structures and hence provide a generic vocabulary to the solution. This can be very expressive when communicating across a larger group.
- Oracle從入門(mén)到精通(第3版)
- Reporting with Visual Studio and Crystal Reports
- Node.js 10實(shí)戰(zhàn)
- Leap Motion Development Essentials
- Java游戲服務(wù)器架構(gòu)實(shí)戰(zhàn)
- Python Network Programming Cookbook(Second Edition)
- INSTANT Mercurial SCM Essentials How-to
- JavaScript+Vue+React全程實(shí)例
- HTML5+CSS3+JavaScript Web開(kāi)發(fā)案例教程(在線實(shí)訓(xùn)版)
- 用Python實(shí)現(xiàn)深度學(xué)習(xí)框架
- Raspberry Pi Home Automation with Arduino(Second Edition)
- Android系統(tǒng)原理及開(kāi)發(fā)要點(diǎn)詳解
- Web前端應(yīng)用開(kāi)發(fā)技術(shù)
- 移動(dòng)互聯(lián)網(wǎng)軟件開(kāi)發(fā)實(shí)驗(yàn)指導(dǎo)
- HTML+CSS+JavaScript網(wǎng)頁(yè)制作:從入門(mén)到精通(第4版)