《全端Web开发:使用JavaScript与Java》


本资料所属分类: 电脑 编程开发 JavaScript 更新时间:2019年5月14日 如不能下载,请查看怎样下载

下面是学习资料下载列表,您可以点击这些文 件名进行下载,如果不能下载,请查看下载帮助

网盘下载链接:全端Web开发:使用JavaScript与Javawww.gxpblog.com.pdf
22.9 MB
www.gxpblog.com电子书 全端Web开发:使用JavaScript与Java

           


目录:


图灵社区的电子书没有采用专有客
户端,您可以在任意设备上,用自
己喜欢的浏览器和PDF阅读器进行
阅读。
但您购买的电子书仅供您个人使用,
未经授权,不得进行传播。
我们愿意相信读者具有这样的良知
和觉悟,与我们共同保护知识产权。
!
如果购买者有侵权行为,我们可能
对该用户实施包括但不限于关闭该
帐号等维权措施,并可能追究法律
责任。
数字版权声明

图灵程序极速分分彩丛书
人 民 邮 电 出 版 社
北  京
Client-Server Web
Apps with JavaScript and Java
[美]Casimir Saternos 著
王群锋 杜欢 译
全端Web开发
使用JavaScript与Java
Beijing • Cambridge • Farnham • Köln • Sebastopol • Tokyo
O’Reilly Media, Inc.授权人民邮电出版社出版
内 容 提 要
JavaScript 和Java 这两大生态系统之间如何协同,成为所有Web 开发人员共同面临的问题。
本书应运而生,全面又简练地为读者展示了最新的C/S 应用开发范式。本书以Java 和JavaScript
这两种最流行的服务器与客户端开发环境为例,全面讲解了最新的C/S 应用开发范式。作者不仅
讲解了很多实用的C/S 开发架构,还通过各种实例进一步强化了读者的认知。
这是一本写给Java 程序员的完整的最新C/S 应用开发范式的指南。
定价:59.00元
读者服务热线:(010)51095186转600 印装质量热线:(010)81055316
反盗版热线:(010)81055315
广告经营许可证:京崇工商广字第 0021 号
著    [美] Casimir Saternos
译    王群锋 杜 欢
责任编辑 毛倩倩
执行编辑 毛倩倩 岳新欣
责任印制 杨林杰
人民邮电出版社出版发行  北京市丰台区成寿寺路11号
邮编 100164  电子邮件 315@ptpress.com.cn
网址 http://www.ptpress.com.cn
北京      印刷
开本:800×1000 1/16
印张:13.75
字数:326千字 2015年 8 月第 1 版
印数:1 — 3 500册 2015年 8 月北京第 1次印刷
著作权合同登记号 图字:01-2014-8385号



iii
版权声明
© 2014 by O’Reilly Media, Inc.
Simplified Chinese Edition, jointly published by O’Reilly Media, Inc. and Posts & Telecom
Press, 2015. Authorized translation of the English edition, 2015 O’Reilly Media, Inc., the
owner of all rights to publish and sell the same.
All rights reserved including the rights of reproduction in whole or in part in any form.
英文原版由O’Reilly Media, Inc. 出版,2014。
简体中文版由人民邮电出版社出版, 2015。英文原版的翻译得到 O’Reilly Media, Inc. 的
授权。此简体中文版的出版和销售得到出版权和销售权的所有者——O’Reilly Media, Inc.
的许可。
版权所有,未得书面许可,本书的任何部分和全部不得以任何形式重制。
O’Reilly Media 通过图书、杂志、在线服务、调查研究和会议等方式传播创新知识。
自1978 年开始,O’Reilly 一直都是前沿发展的见证者和推动者。超级极客们正在开创
着未来,而我们关注真正重要的技术趋势——通过放大那些“细微的信号”来刺激社
会对新科技的应用。作为技术社区中活跃的参与者,O’Reilly 的发展充满了对创新的
倡导、创造和发扬光大。
O’Reilly 为软件开发人员带来革命性的“动物书”;创建第一个商业网站(GNN);组
织了影响深远的开放源代码峰会,以至于开源软件运动以此命名;创立了Make 杂志,
从而成为DIY 革命的主要先锋;公司一如既往地通过多种形式缔结信息与人的纽带。
O’Reilly 的会议和峰会集聚了众多超级极客和高瞻远瞩的商业领袖,共同描绘出开创
新产业的革命性思想。作为技术人士获取信息的选择,O’Reilly 现在还将先锋专家的
知识传递给普通的计算机用户。无论是通过书籍出版,在线服务或者面授课程,每一
项O’Reilly 的产品都反映了公司不可动摇的理念——信息是激发创新的力量。
业界评论
“O’Reilly Radar 博客有口皆碑。”
——Wired
“O’Reilly 凭借一系列(真希望当初我也想到了)非凡想法建立了数百万美元的业务。”
——Business 2.0
“O’Reilly Conference 是聚集关键思想领袖的绝对典范。”
——CRN
“一本O’Reilly 的书就代表一个有用、有前途、需要学习的主题。”
——Irish Times
“Tim 是位特立独行的商人,他不光放眼于最长远、最广阔的视野并且切实地按照
Yogi Berra 的建议去做了:‘如果你在路上遇到岔路口,走小路(岔路)。’回顾过去
Tim 似乎每一次都选择了小路,而且有几次都是一闪即逝的机会,尽管大路也不错。”
——Linux Journal
O’Reilly Media, Inc.介绍
v
目录
前言 ........................................................................................................................................................xiii
第1 章 因变而变 ................................................................................................................................1
1.1 Web 用户 ....................................................................................................................................2
1.2 技术 .............................................................................................................................................2
1.3 软件开发 .....................................................................................................................................3
1.4 哪些没变 .....................................................................................................................................4
1.4.1 Web 的本质 ....................................................................................................................5
1.4.2 为什么说服务器驱动的Web 开发有害 .......................................................................6
1.5 为什么需要客户端- 服务器端的Web 应用 ...........................................................................7
1.5.1 代码组织结构/ 软件架构 .............................................................................................7
1.5.2 “极速分分彩的灵活性”与“使用开源API” .........................................................................7
1.5.3 原型 ................................................................................................................................7
1.5.4 开发者的效率 ................................................................................................................8
1.5.5 应用性能 ........................................................................................................................8
1.6 小结 .............................................................................................................................................9
第2 章 JavaScript 和JavaScript 工具 .....................................................................................11
2.1 学习JavaScript .........................................................................................................................12
2.2 JavaScript 的历史 .....................................................................................................................13
2.3 一门函数式极速分分彩 .......................................................................................................................14
2.3.1 作用域 ..........................................................................................................................15
2.3.2 一级函数 ......................................................................................................................16
2.3.3 函数声明和表达式 ......................................................................................................17
2.3.4 函数调用 ......................................................................................................................19
vi | 目录
2.3.5 函数参数 ......................................................................................................................19
2.3.6 对象 ..............................................................................................................................20
2.4 面向Java 开发者的JavaScript ................................................................................................20
2.4.1 HelloWord.java .............................................................................................................20
2.4.2 带变量的HelloWord.java ............................................................................................23
2.5 最佳开发实践 ...........................................................................................................................25
2.5.1 编码规范和约定 ..........................................................................................................25
2.5.2 浏览器 ..........................................................................................................................26
2.5.3 集成开发环境 ..............................................................................................................26
2.5.4 单元测试 ......................................................................................................................27
2.5.5 文档 ..............................................................................................................................27
2.6 项目 ...........................................................................................................................................27
第3 章  REST 和JSON ................................................................................................................33
3.1 什么是REST ............................................................................................................................34
3.1.1 资源 ..............................................................................................................................34
3.1.2 动词(HTTP 请求) .....................................................................................................34
3.1.3 统一资源标识符 ..........................................................................................................35
3.2 REST 约束 ................................................................................................................................36
3.2.1 客户端- 服务器端 ......................................................................................................36
3.2.2 无状态 ..........................................................................................................................36
3.2.3 可缓存 ..........................................................................................................................37
3.2.4 统一接口 ......................................................................................................................37
3.2.5 分层 ..............................................................................................................................38
3.2.6 按需交付代码 ..............................................................................................................38
3.3 HTTP 响应代码 ........................................................................................................................38
3.4 JSON .........................................................................................................................................39
3.5 HATEOAS ................................................................................................................................40
3.6 API 衡量和分类 .......................................................................................................................43
3.7 函数式编程和REST ................................................................................................................43
3.8 项目 ...........................................................................................................................................44
3.9 其他Web API 工具 ..................................................................................................................48
3.10 约束回顾 .................................................................................................................................48
第4 章 Java 工具 ............................................................................................................................49
4.1 Java 极速分分彩 ...................................................................................................................................49
4.2 Java 虚拟机 ...............................................................................................................................50
4.3 Java 工具 ...................................................................................................................................51
4.4 构建工具 ...................................................................................................................................52
4.4.1 Maven 的优点 ..............................................................................................................54
目录 | vii
4.4.2 Maven 的功能 ..............................................................................................................54
4.4.3 版本控制 ......................................................................................................................55
4.4.4 单元测试 ......................................................................................................................56
4.5 处理JSON 的Java 类库 ..........................................................................................................56
4.6 项目 ...........................................................................................................................................57
4.6.1 用Java 处理JSON .......................................................................................................57
4.6.2 用JVM 上的脚本极速分分彩处理JSON ..............................................................................59
4.7 小结 ...........................................................................................................................................62
第5 章 客户端框架 .........................................................................................................................65
5.1 概述 ...........................................................................................................................................65
5.2 起点一:响应式Web 极速分分彩 .....................................................................................................67
5.2.1 HTML5 Boilerplate ......................................................................................................68
5.2.2 Bootstrap .......................................................................................................................68
5.3 起点二:JavaScript 库和框架 .................................................................................................69
5.3.1 浏览器兼容性 ..............................................................................................................69
5.3.2 框架 ..............................................................................................................................69
5.3.3 功能 ..............................................................................................................................70
5.3.4 流行程度 ......................................................................................................................70
5.4 获取起始项目 ...........................................................................................................................71
5.4.1 直接从仓库下载 ..........................................................................................................71
5.4.2 从入门网站下载 ..........................................................................................................71
5.4.3 IDE 生成的起始项目 ...................................................................................................72
5.5 前端工程师的崛起 ...................................................................................................................72
5.5.1 客户端模板 ..................................................................................................................72
5.5.2 资源管道 ......................................................................................................................73
5.5.3 开发流程 ......................................................................................................................74
5.6 项目 ...........................................................................................................................................74
5.7 小结 ...........................................................................................................................................76
第6 章 Java Web API 服务器 .....................................................................................................77
6.1 更简单的服务器端解决方案 ...................................................................................................77
6.2 基于Java 的服务器 ..................................................................................................................79
6.2.1 Java HTTP 服务器 .......................................................................................................79
6.2.2 Jetty 嵌入式服务器 ......................................................................................................81
6.2.3 Restlet ...........................................................................................................................82
6.2.4 Roo ................................................................................................................................83
6.2.5 Netty 嵌入式服务器.....................................................................................................87
6.2.6 Play 服务器 ..................................................................................................................89
6.2.7 其他轻量级服务器 ......................................................................................................92
viii | 目录
6.3 基于JVM 的服务器 .................................................................................................................92
6.4 Web 应用服务器 ......................................................................................................................93
6.5 如何在开发中使用 ...................................................................................................................94
6.6 小结 ...........................................................................................................................................94
第7 章  快速开发实践 ....................................................................................................................95
7.1 开发者的生产率 .......................................................................................................................95
7.2 优化开发者和团队的工作流程 ...............................................................................................98
7.2.1 例子:修复Web 应用 .................................................................................................99
7.2.2 例子:测试集成 ........................................................................................................100
7.2.3 例子:绿地开发 ........................................................................................................101
7.3 生产率和软件开发生命周期 .................................................................................................101
7.3.1 管理方式和企业文化 ................................................................................................102
7.3.2 技术架构 ....................................................................................................................102
7.3.3 软件工具 ....................................................................................................................103
7.3.4 性能 ............................................................................................................................104
7.3.5 测试 ............................................................................................................................104
7.3.6 底层平台 ....................................................................................................................105
7.4 小结 .........................................................................................................................................106
第8 章 API 极速分分彩 ............................................................................................................................107
8.1 极速分分彩的起点 .............................................................................................................................108
8.2 实用的Web API 与REST API ..............................................................................................109
8.3 指引 .........................................................................................................................................110
8.3.1 名词即资源,动词即HTTP 行为 ............................................................................110
8.3.2 请求参数作为修饰符 ................................................................................................ 111
8.3.3 Web API 版本 .............................................................................................................112
8.3.4 HTTP 标头 .................................................................................................................113
8.3.5 链接 ............................................................................................................................113
8.3.6 响应 ............................................................................................................................113
8.3.7 文档 ............................................................................................................................113
8.3.8 格式约定 ....................................................................................................................114
8.3.9 安全性 ........................................................................................................................114
8.4 项目 .........................................................................................................................................114
8.4.1 运行项目 ....................................................................................................................114
8.4.2 服务端代码 ................................................................................................................115
8.4.3 Curl 和jQuery ............................................................................................................117
8.5 实践理论 .................................................................................................................................118
目录 | ix
第9 章 jQuery 和Jython .............................................................................................................119
9.1 服务端:Jython ......................................................................................................................120
9.1.1 Python Web 服务器 ....................................................................................................120
9.1.2 Jython Web 服务器 .....................................................................................................120
9.1.3 Mock API ....................................................................................................................121
9.2 客户端:jQuery ......................................................................................................................122
9.2.1 DOM 遍历和操作 ......................................................................................................122
9.2.2 实用函数 ....................................................................................................................123
9.2.3 效果 ............................................................................................................................124
9.2.4 事件处理 ....................................................................................................................124
9.2.5 Ajax .............................................................................................................................124
9.3 jQuery 和更高级的抽象 .........................................................................................................125
9.4 项目 .........................................................................................................................................125
9.4.1 基础HTML ................................................................................................................126
9.4.2 JavaScript 和jQuery ...................................................................................................126
9.5 小结 .........................................................................................................................................128
第10 章 JRuby 和Angular ........................................................................................................129
10.1 服务器端:JRuby 和Sinatra ...............................................................................................130
10.1.1 工作流 .....................................................................................................................130
10.1.2 交互式Ruby shell ...................................................................................................131
10.1.3 Ruby 版本管理器 ...................................................................................................131
10.1.4 包 .............................................................................................................................132
10.1.5 Sinatra ......................................................................................................................133
10.1.6 JSON 处理 ..............................................................................................................134
10.2 客户端:AngularJS ..............................................................................................................135
10.2.1 模型 .........................................................................................................................135
10.2.2 视图 .........................................................................................................................135
10.2.3 控制器 .....................................................................................................................136
10.2.4 服务 .........................................................................................................................136
10.3 比较jQuery 和Angular ........................................................................................................136
10.3.1 DOM 和模型操作 ...................................................................................................136
10.3.2 Angular 的不可见性 ...............................................................................................137
10.4 项目 .......................................................................................................................................137
10.5 小结 .......................................................................................................................................143
第11 章 打包和部署 .....................................................................................................................145
11.1 打包Java 和JEE 应用 .........................................................................................................145
11.2 JEE 应用的部署 ...................................................................................................................147
x | 目录
11.2.1 图形界面管理 .........................................................................................................148
11.2.2 命令行管理 .............................................................................................................150
11.3 非JEE 应用的部署 ..............................................................................................................151
11.3.1 服务器在应用之外 .................................................................................................152
11.3.2 服务器和应用并行 .................................................................................................152
11.3.3 服务器在应用里面 .................................................................................................154
11.4 不同部署方式带来的影响 ...................................................................................................154
11.4.1 负载均衡 .................................................................................................................155
11.4.2 自动化应用部署 .....................................................................................................156
11.5 项目 .......................................................................................................................................157
11.5.1 客户端 .....................................................................................................................157
11.5.2 服务器端 .................................................................................................................158
11.6 小结 .......................................................................................................................................158
第12 章 虚拟化 ..............................................................................................................................159
12.1 全虚拟化 ...............................................................................................................................159
12.2 虚拟机的实现 .......................................................................................................................161
12.2.1 VMWare ..................................................................................................................161
12.2.2 VirtualBox ...............................................................................................................161
12.2.3 Amazon EC2 ...........................................................................................................161
12.3 虚拟机的管理 .......................................................................................................................162
12.3.1 Vagrant ....................................................................................................................162
12.3.2 Packer ......................................................................................................................162
12.3.3 DevOps 配置管理 ...................................................................................................163
12.4 容器 .......................................................................................................................................163
12.4.1 LXC .........................................................................................................................164
12.4.2 Docker .....................................................................................................................164
12.5 项目 .......................................................................................................................................165
12.5.1 Docker 帮助 ............................................................................................................166
12.5.2 镜像和容器的维护 .................................................................................................166
12.5.3 在Docker 里使用Java ...........................................................................................167
12.5.4 Docker 和Vagrant 的网络设置 ..............................................................................169
12.6 小结 .......................................................................................................................................170
第13 章 测试和文档 .....................................................................................................................171
13.1 测试的种类 ...........................................................................................................................172
13.1.1 “正式”与“非正式” .............................................................................................172
13.1.2 测试范围 .................................................................................................................172
13.1.3 谁来测?测什么?为谁测 .....................................................................................173
13.2 测试反映了组织的成熟度 ...................................................................................................173
目录 | xi
13.2.1 使用软件能力成熟度模型评价流程 .....................................................................173
13.2.2 使用Maven 促进流程统一 ....................................................................................174
13.2.3 使用行为驱动开发促进流程统一 .........................................................................176
13.3 测试框架 ...............................................................................................................................176
13.3.1 JUnit ........................................................................................................................177
13.3.2 Jasmine ....................................................................................................................177
13.3.3 Cucumber ................................................................................................................178
13.4 项目 .......................................................................................................................................179
13.4.1 JUnit ........................................................................................................................180
13.4.2 Jasmine ....................................................................................................................180
13.4.3 Cucumber ................................................................................................................181
13.4.4 Maven 报告 .............................................................................................................181
13.5 小结 .......................................................................................................................................182
第14 章 总结 ..................................................................................................................................183
14.1 社区 .......................................................................................................................................183
14.2 历史 .......................................................................................................................................184
14.3 尾声 .......................................................................................................................................184
附录A JRuby IRB 及Java API ................................................................................................185
附录B REST 式的Web API 总结 ............................................................................................191
附录C 参考文献 ............................................................................................................................196


上一篇 下一篇
发表评论

网友评论仅供网友表达个人看法,并不表明本网同意其观点或证实其描述。

查看全部回复【已有0位网友发表了看法】