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
146
6
开发的方法论与哲学
么样的应用程序,都不能信任用户的输入,除非输入已被处理过。恶意行
为者可能正在考虑入侵我们的服务器或盗取客户的数据,或以其他方式将
内容注入我们的网页。这些用户可能是应用程序的使用者甚至是内部员工,
因此在进行输入处理时,应该对所有人都一视同仁。
设身处地为接口使用者着想,是防止编写出不成熟的接口的最佳方法。你
可以进行这样的思考练习,停下来思考你希望如何使用一个接口,以及在
使用它时你可能需要用到的不同方式,那么最终你一定会编写出一个更好
的接口。这并不是说我们希望让接口使用者自己完成所有的事情,而是希
望让接口的调用变得尽可能简单,不烦琐。如果使用者在使用接口之后仍
然需要在代码中包含很长的业务逻辑块,我们就需要停下来问问自己 :这
些业务逻辑是否应该由接口提供而不是放在接口外面?
6.4
 构建、部署与运行
构建过程有多个方面。从宏观上来说,我们在共享逻辑中安装和编译资源,
以便运行时应用程序可以使用它们。这意味着在安装系统或应用程序依赖
项,将文件复制到不同的目录,编译为不同的语言,或将文件打包在一起时,
应用程序可能还有许多其他的需求。
要在开发、预发布和生产环境中成功地管理应用程序,关键是明确定义和
描述构建过程。这些常见环境以及其他你可能遇到的环境,都是用于特定
的目的的,你也可以从服务该目的的过程中获益。
在开发时,我们关注增强的调试工具、使用库的开发环境版本、源代码映
射和详细的日志记录级别。我们也依赖覆盖行为的自定义方式,以便可以
轻松模仿生产环境的样子,并且在可能的情况下 ...
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