Skip to Content
精通模块化JavaScript
book

精通模块化JavaScript

by Nicolás Bevacqua
April 2020
Intermediate to advanced
177 pages
1h 45m
Chinese
Publishing House of Electronics Industry
Content preview from 精通模块化JavaScript
本书的结构
xi
本书的结构
1
章讨论
JavaScript
语境下模块化编程的演变,从早期直接在
onclick
属性中嵌入的
JavaScript
,到
CommonJS
,最后到原生
ECMAScript
模块。
然后,介绍编写自包含代码的好处,以及在系统的每个级别(服务、应用
程序、组件、模块、函数、块等)都这么做的好处。
2
章涵盖了模块化设计的要点,为你打下一个基础,让你能在这个基础
上编写对
API
层面友好的模块,并且知道这个模块会被如何(在所有可能
的情况下)使用、其职责是什么,以及哪些部分属于接口。
3
章的大部分内容都是在帮助你理解要解决的各种问题,以及如何在解
决那些问题的同时密切关注模块及其接口的演变,并且在等待清晰的模式
出现前尽量不要进行抽象。本章刺破表象,让你将自己的上下文应用到待
解决的问题上,启发你对文档、错误处理,以及遵循自己的推理等主题的
最佳实践的思考。
4
章讨论内部复杂性、紧耦合,以及如何权衡框架和约束(
convention
的优点。这一章的大部分篇幅都在讨论通过重构代码来降低复杂性的各种
方法,然后讨论与复杂性相关的状态的作用,以及如何降低复杂性。数据
结构也非常重要,因为在控制复杂性时,选择正确的数据结构虽然具有挑
战性,却可以带来巨大的回报。
5
章专门讨论
JavaScript
,详细介绍了如何利用现代语言结构来编写简洁
的程序。这一章还研究了继承和组合等模式,进而引出如何根据实际用例
来做正确的选择的讨论。最后,我们也梳理了经典模式,例如解释什么是
模式、对象工厂、事件触发和
JSON ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.

Read now

Unlock full access

More than 5,000 organizations count on O’Reilly

AirBnbBlueOriginElectronic ArtsHomeDepotNasdaqRakutenTata Consultancy Services

QuotationMarkO’Reilly covers everything we've got, with content to help us build a world-class technology community, upgrade the capabilities and competencies of our teams, and improve overall team performance as well as their engagement.
Julian F.
Head of Cybersecurity
QuotationMarkI wanted to learn C and C++, but it didn't click for me until I picked up an O'Reilly book. When I went on the O’Reilly platform, I was astonished to find all the books there, plus live events and sandboxes so you could play around with the technology.
Addison B.
Field Engineer
QuotationMarkI’ve been on the O’Reilly platform for more than eight years. I use a couple of learning platforms, but I'm on O'Reilly more than anybody else. When you're there, you start learning. I'm never disappointed.
Amir M.
Data Platform Tech Lead
QuotationMarkI'm always learning. So when I got on to O'Reilly, I was like a kid in a candy store. There are playlists. There are answers. There's on-demand training. It's worth its weight in gold, in terms of what it allows me to do.
Mark W.
Embedded Software Engineer

You might also like

数据驱动力:企业数据分析实战

数据驱动力:企业数据分析实战

Carl Anderson
基于Python的智能文本分析

基于Python的智能文本分析

Benjamin Bengfort, Rebecca Bilbro, Tony Ojeda
Lua游戏AI开发指南

Lua游戏AI开发指南

Posts & Telecom Press, David Young

Publisher Resources

ISBN: 9787121387074