设计开发实效 Web2.0 应用程序

26
设计开发实效 Web2.0 应用程序 朱可 (@shawnzhu) 软件工程师 IBM 中国开发实验室新兴技术中心

description

2010年中科院夏季讲座 Web2.0 系列

Transcript of 设计开发实效 Web2.0 应用程序

Page 1: 设计开发实效 Web2.0 应用程序

设计开发实效 Web2.0 应用程序

朱可 (@shawnzhu)

软件工程师

IBM 中国开发实验室新兴技术中心

Page 2: 设计开发实效 Web2.0 应用程序

2

内容概况

从实际出发看 Web2.0 应用程序开发 • 趋势和主题

• 从核心问题入手

• 实用主义观点

• 工具和技能

Page 3: 设计开发实效 Web2.0 应用程序

Copyright 2010 © IBM Corporation

3

Web2.0: 2010

• 社会网络与社会化游戏

• 在线Web应用程序商店

• 微博客

• 在线商店和在线支付

• 基于位置和地理信息的应用

• 互联网电视、在线电影和视频

Page 4: 设计开发实效 Web2.0 应用程序

4

Web2.0 开发的核心问题

• 更多的用户数量

• 更多的在线任务

• 越来越多的相互联系的数据

• 安全威胁与隐私保护

• 新的客户端平台

Page 5: 设计开发实效 Web2.0 应用程序

5

Web2.0 开发新主题

基于Web的开放编程接口

大规模数据分析

云计算

移劢Web

Page 6: 设计开发实效 Web2.0 应用程序

6

Web 应用程序之实用主义观点

• 用户体验 (User experience)

• 成本 (Costs)

• 系统复杂度 (System complexity)

• 可测试的系统 (Testable system)

• 行劢敏捷 (Do things agile)

Page 7: 设计开发实效 Web2.0 应用程序

7

用户体验

Page 8: 设计开发实效 Web2.0 应用程序

8

“It's the Customer, Stupid!”

• 简单易用的用户体验设计

• 清晰的信息架构

• 多重访问渠道 • 浏览器

(http://en.wikipedia.org/wiki/OpenSocial) (http://thepcsecurity.com/use-multiple-browsers-to-ensure-internet-security/)

移劢设备同步应用 API 访问 (如 OpenSocial)

Page 9: 设计开发实效 Web2.0 应用程序

9

简单易用的用户体验设计

保持一致的 UI 模型

• Yahoo! Design library

• Dijit from Dojo toolkit

• jQuery widget

提供反馈信息

保持简洁

(http://ajaxian.com/archives/dissecting-dijit-dojo-widgets)

(http://developer.yahoo.com/ypatterns/selection/autocomplete.html)

Page 10: 设计开发实效 Web2.0 应用程序

10

用户体验设计之 IBM OneUI

描述 CSS 和 HTML 结构

• 通用布局

• UI 组件

• 主题

<link rel="stylesheet" href="/static/css/core.css" type="text/css"/>

<link rel="stylesheet" href="/static/css/defaultTheme.css" type="text/css"/>

<body class="lotusui">

Page 11: 设计开发实效 Web2.0 应用程序

11

清晰的信息架构设计

Logo

Title

Category

Navigation tab

Tips & wizard

Filters

Footer Common links

Page 12: 设计开发实效 Web2.0 应用程序

12

信息架构设计之HTML文档参考

<body>

<header><nav><!-- navigation --></nav></header>

<aside><!-– filters in tag cloud --></aside>

<div>

<section><!-– tips --></section>

<section><!–- content list --></section>

<!–- other sections -->

</div>

<footer><!-- declaration --></footer>

</body>

Page 13: 设计开发实效 Web2.0 应用程序

13

通过良好的架构管理系统复杂度,控制运营成本

Page 14: 设计开发实效 Web2.0 应用程序

14

实效Web2.0应用程序架构

• 应用设计原则分离关注点 – 会话(session)信息的保存

– 事务与数据一致性检查

– 可用性

– 规模化

– 数据存储

– 可管理性

负载平衡器

Web容器

Web应用 Web容器

Web应用

主数据库 从数据库

典型Web2.0应用程序架构参考

缓存

Page 15: 设计开发实效 Web2.0 应用程序

15

使用云计算基础设施部署 Web 应用

• 弹性基础设施 • 按需支付

• 高可伸缩性

• 海量数据存储

• 管理与监视能力

Amazon S3 (Elastic CDN)

Amazon Elastic Load Balancing

WebSphere sMash On Amazon EC2

Amazon RDB Amazon SimpleDB

WebSphere sMash + Amazon Web Services

Public Network

Page 16: 设计开发实效 Web2.0 应用程序

16

在云计算平台上开发 Web 应用

使用方便但选择有限

• Google AppEngine: Python or Java

• Sina AppEngine: PHP

按使用率付费

Page 17: 设计开发实效 Web2.0 应用程序

17

可测试的系统

“Test when possible.”

Page 18: 设计开发实效 Web2.0 应用程序

18

测试 Web2.0 应用程序

“Test twice, write once.” 普及单元测试

• JUnit, Ruby ‘test/unit’, Python ‘unittest’, PHPT

功能测试

• django.test.client.Client

• curl

• java.net.URLConnection

性能测试

• Apache JMeter, LoadRunner

集成测试

• Selenium

Page 19: 设计开发实效 Web2.0 应用程序

19

工具和技能

• 新兴编程语言

• 云计算技术

• 新兴数据库技术

• 可复用的组件服务 • OpenID, Online Map, Google search, 在线

相册, 在线文件分享,即时通信服务(XMPP, Wave)

Page 20: 设计开发实效 Web2.0 应用程序

20

选择数据库

• 关系型数据库 • 最为常用,面向结构化数据的查询和编辑

• 非关系型数据库(NoSQL) • 列数据库: HBase, Cassandra

• 键值对数据库: CouchDB, MongoDB, AWS SimpleDB

• 内容数据库: JCR, AWS S3

提示: 只有在 SQL 数据库无法满足功能性需要时,再选择 NoSQL 数据库

Page 21: 设计开发实效 Web2.0 应用程序

21

行劢敏捷

Page 22: 设计开发实效 Web2.0 应用程序

22

敏捷风格的开发过程

原则 • 尽早、经常地交付可用的软件

• 保持简单

方法论 • DRY – Don’t repeat your self

• 尽可能多地测试

• 代码重构与设计重构

• 从错误和失败中学习

Page 23: 设计开发实效 Web2.0 应用程序

23

Web2.0 应用程序的安全

提防安全漏洞保护 Web 应用 • XSS (跨站脚本)

• CSRF (跨站请求伪造)

使用开放安全协议保护用户隐私 • 使用 SSL 加密通信传输

• 使用 OpenID 管理用户身份信息

• 使用 OAuth 与第三方服务交换数据

Page 24: 设计开发实效 Web2.0 应用程序

24

小结

• 简单易用的用户体验设计

• 通过良好的架构管理系统复杂度,控制运营成本

• 构建可测试的系统

• 把握敏捷行劢的原则和方法

• 注重应用程序安全和用户隐私

Page 26: 设计开发实效 Web2.0 应用程序

26

© IBM Corporation 2010. All Rights Reserved.

The workshops, sessions and materials have been prepared by IBM or the session speakers and ref lect their own views. They are provided for

informational purposes only, and are neither intended to, nor shall have the ef fect of being, legal or other guidance or advice to any participant. While

ef forts were made to verify the completeness and accuracy of the information contained in this presentation, it is provided A S IS without warranty of

any kind, express or implied. IBM shall not be responsible for any damages arising out of the use of , or otherwise related to , this presentation or any

other materials. Nothing contained in this presentation is intended to, nor shall have the ef fect of, creating any warranties or representations f rom IBM

or its suppliers or licensors, or altering the terms and conditions of the applicable license agreement governing the use of IBM sof tware.

References in this presentation to IBM products, programs, or services do not imply that they will be available in all countr ies in which IBM operates.

Product release dates and/or capabilities referenced in this presentation may change at any time at IBM’s sole discretion bas ed on market

opportunities or other factors, and are not intended to be a commitment to future product or feature availability in any way. Nothing contained in these

materials is intended to, nor shall have the ef fect of, stating or implying that any activities undertaken by you will result in any specif ic sales, revenue

growth or other results.

Performance is based on measurements and projections using standard IBM benchmarks in a controlled environment. The actual th roughput or

performance that any user will experience will vary depending upon many factors, including considerations such as the amount of multiprogramming

in the user's job stream, the I/O conf iguration, the storage conf iguration, and the workload processed. Therefore, no assurance can be given that an

individual user will achieve results similar to those stated here.

All customer examples described are presented as illustrations of how those customers have used IBM products and the results they may have

achieved.

Actual environmental costs and performance characteristics may vary by customer.

The following are trademarks of the International Business Machines Corporation in the United States and/or other countries:

ibm.com/legal/copytrade.shtml AIX, CICS, CICSPlex, DataPower, DB2, DB2 Universal Database, i5/OS, IBM, the IBM logo, IMS/ESA, Power

Systems, Lotus, OMEGAMON, OS/390, Parallel Sysplex, pureXML, Rational, Redbooks, Sametime, SMART SOA, System z , Tivoli, WebS phere,

and z/OS.

A current list of IBM trademarks is available on the Web at “Copyright and trademark information” at ibm.com/legal/copytrade. shtml.

Adobe, the Adobe logo, PostScript, and the PostScript logo are either registered trademarks or trademarks of Adobe Systems Incorporated in the

United States, and/or other countries.

IT Inf rastructure Library is a registered trademark of the Central Computer and Telecommunications Agency which is now part o f the Off ice of

Government Commerce

Java and all Java-based trademarks are trademarks of Sun Microsystems, Inc. in the United States, other countries, or both.

Microsof t and Windows are trademarks of Microsoft Corporation in the United States, other countries, or both.

ITIL is a registered trademark, and a registered community trademark of the Off ice of Government Commerce, and is registered in the U.S. Patent

and Trademark Off ice

Intel and Pentium are trademarks or registered trademarks of Intel Corporation or its subsidiaries in the United States and o ther countries.

UNIX is a registered trademark of The Open Group in the United States and other countries.

Linux is a registered trademark of Linus Torvalds in the United States, other countries, or both.