Contenu connexe
Similaire à Simplified Web2.0 application development with Project Zero (20)
Simplified Web2.0 application development with Project Zero
- 2. projectzero.org
Outline
• Web 2.0 application requirements?
• Programming language landscape
• Options? Project Zero
• Get started
• Demo
Copyright 2009 © IBM Corporation
- 3. projectzero.org
Show of Hands
• Are you using Ruby, PHP, Python, Groovy?
• How many are using Struts/Spring/Hibernate?
• What do you want from this session?
– Know technical trends
– To be a developer
– Project zero is a cool name
– Credit
Copyright 2009 © IBM Corporation
- 4. projectzero.org
Outline
• Web 2.0 application requirements?
• Programming language landscape
• Options? Project Zero
• Get started
• Demo
Copyright 2009 © IBM Corporation
- 5. projectzero.org
So Many
Web 2.0
Applications
http://flickr.com/photos/stabilo-boss/101793494/ Copyright 2009 © IBM Corporation
- 6. projectzero.org
Take One Pretty Example
搜索服务 http://netvibes.com/shawnzhu 天气预报
相册照片
电子邮件收件箱
日历
Copyright 2009 © IBM Corporation
Twitter 工具
- 8. projectzero.org
The Cake is divided in a mashup way
indirect
access
direct
access
App App App App App App
Your API Your API
Your Application Your Application Your Application
Your 3rd-party 3rd-party
Your Database Your Database Database API API
Copyright 2009 © IBM Corporation
- 9. projectzero.org
General Requirements
• More user participation
• Distributed data and service
• Complex application logic
• Highly customization
• Many 3rd-party sources
• Low latency
• Multiple clients
Copyright 2009 © IBM Corporation
- 10. projectzero.org
Trends
Web 1.0 Web 2.0 ?
价值来源 中心化 去中心化 去中心化
反馈循环周期 月、周 天、分钟 天、分钟
交互模型 请求、响应 Rich user experience 自发、自治
产品 难以复制的数据 数据生态系统
核心战略资产
发布者进行发布
数据生成方式 用户可以贡献内容 数据本身的语义
“ 占地盘”
有效的增长方式 网络效应 “ 新陈代谢”
统一模式或分类
数据结构 大众分类 隐含的元数据
竞争
资源分配方式 用户参与 开放供应链
信息发布者
最重要的数据来源 大规模人群 环境
Copyright 2009 © IBM Corporation
- 11. projectzero.org
Common Themes In Web2.0
• Massive amounts data
• Rich user experience
• Application is growing
• Time to value
• Flexibility
• Security
Copyright 2009 © IBM Corporation
- 12. projectzero.org
Outline
• Web 2.0 application requirements?
• Programming language landscape
• Options? Project Zero
• Get started
• Demo
Copyright 2009 © IBM Corporation
- 13. projectzero.org
Popular Web 2.0 Technology
Feeds
A data format used to exchange Dynamic Scripting
frequently updated web content
Dynamic languages are flexible and easy
XML data streams in formats such as to learn
RSS and Atom Adoption is growing as developers focus
more on Internet-centric applications
Mashups
A lightweight web application that REST
combines data from more than one
source into an integrated and new, An architectural style that is best
useful experience exemplified by HTTP
REST embodies the principles of a
service-oriented architecture using the web
as the SOA platform
Ajax
Asynchronous JavaScript and XML -
Ajax, is a group of inter-related web
development techniques used for creating
interactive web applications
Copyright 2009 © IBM Corporation
- 14. projectzero.org
Browser-side Programming Is
Hard
• Fighting for complexity
– HTML: structure data
– CSS: presentation
– JavaScript/Ajax: logic and interaction
– Server Integration
• Multiple browser
– Internet Explorer
– Firefox, Safari, Opera, etc
Copyright 2009 © IBM Corporation
- 15. projectzero.org
How? Read Books
http://covers.oreilly.com/images/9780596527327/cat.gif http://covers.oreilly.com/images/9780596101992/cat.gif
Copyright 2009 © IBM Corporation
- 16. projectzero.org
Which programming languages
works with AJAX?
source: ajaxian.com survey “State of the Web 2008” (January 9th, 2009) http://ajaxian.com/archives/state-of-the-
web-2008
Copyright 2009 © IBM Corporation
- 17. projectzero.org
Scripting languages and Frameworks
• Millions of PHP developers
• Popular web languages like Python and Ruby
are agile and dynamic languages
• Developers like the popular frameworks like
Ruby on Rails, Grails, Django
– “That’s what I expected exactly!”
– Rapid development
• Easy to learn (according to learning Java or C#)
Copyright 2009 © IBM Corporation
- 18. projectzero.org
New Approaches in Java
Technology
Source: Best of Breed vs. Best of Brand: The Battle of the Application Platform Stacks, Yefim Natis, Gartner, APN19_137, 12/07, AE
Copyright 2009 © IBM Corporation
- 19. projectzero.org
Groovy
• Groovy is an agile and dynamic language
for the Java Virtual Machine
• Builds upon the strengths of Java but has
additional power features inspired by
languages like Python and Ruby
• Compiles straight to Java byte code so you
can use it anywhere you can use Java
http://www.manning.com/koenig/koenig_cover150.jpg
def number=0
// list a file with line numbers
new File ('test.groovy').eachLine { line ->
number++
println "$number: $line"
}
Copyright 2009 © IBM Corporation
- 20. projectzero.org
Outline
• Web 2.0 application requirements?
• Programming language landscape
• Options?
• Get started
• Demo
Copyright 2009 © IBM Corporation
- 21. projectzero.org
What is Project Zero?
• A development community delivering the
best of agile Web 2.0
• Delivered WebSphere sMash
– PHP scripting, REST and Dojo in ONE
integrated runtime and tooling package
JavaScript toolkit
http://dojofoundation.org/media/img/dojo.logo.png
Copyright 2009 © IBM Corporation
- 23. projectzero.org
WebSphere sMash Core Values
• Convention over configuration
速度 • Application is server
• Rich User Interfaces Support
• Consistent application approach
• End to end web-based tooling
简洁 • Visual & programmatic editors
• Dynamic Scripting Support
敏捷 • Integrated runtime
• Pre-built services
Copyright 2009 © IBM Corporation
- 25. projectzero.org
a dynamic scripting platform
• Create Application Logic in one of two
scripting languages
– Groovy (for people that prefer Java)
– PHP (for the 3 Million existing PHP programmers)
• Java is positioned as the “system”
language
– implement system extensions and application libraries
– You can use Java (if desired)
Copyright 2009 © IBM Corporation
- 26. projectzero.org
PHP Support
• PHP runtime built in Java
– To PHP.net as JRuby is to Ruby and Jython is
to Python
• Powerful blending of PHP and Java code
– Java and PHP code run in the same process
on the same Thread
• No need for Inter-process communication
Copyright 2009 © IBM Corporation
- 27. projectzero.org
Optimized for REST
• Effortless creation of RESTful services
and data feeds (RSS, Atom)
script as a resource
– http://<host>:<port>/Employee.php
Copyright 2009 © IBM Corporation
- 28. projectzero.org
RESTfully Expose Data
Enable Developers With A Simple Programmatic And HTTP Data API
WebSphere sMash application
Access REST resource
through AJAX /app/resources/
employees.groovy
ZRM.delegate( RDBMS
)
/app/models/
employees.json
Model application data
• Constrained set of APIs encourage a RESTful application
architecture
• Data model that maps well into Atom feeds and JSON
formats
• Robust framework for persistence, validation, and
Access resource data with Dojo serialization
Copyright 2009 © IBM Corporation
- 29. projectzero.org
Platform Overview
• Application-centric runtime
– No “container”
– Instant on
– Clean (short-live process)
– Cheap (small footprint)
• A full stack runtime for Web
– Built-in everything you need
– Modular architecture
• You just need a JVM
– Java SE 5 or 6
Copyright 2009 © IBM Corporation
- 30. projectzero.org
Security Offerings
• System-level authentication and authorization
• OpenID consumer
• Protection against Cross-Site Request Forgery
(CSRF) attacks
• User service You don’t have to understand how
• Security token this piece of configuration works,
just need to know how simple it
• Extensibility enables basic authentication on
specific URI pattern
@include "security/basicAuthentication.config" {
"conditions": "/request/path =~ /customers(/.*)?"
}
Copyright 2009 © IBM Corporation
- 31. projectzero.org
Built-in Development Tooling –
App Builder
• Web-based IDE
– lets developers build application directly on the Web
• Built as a sMash application
• Provides full development lifecycle
for sMash applications
– Create, run, test, debug
– Manage dependencies
• Provides visual/source editors
– page
– forms
– scripts
– iWidgets
– activities
Copyright 2009 © IBM Corporation
- 32. projectzero.org
Social Capacity
• Application life cycle management
– Command Line
– REST API
– Administration tool
Copyright 2009 © IBM Corporation
- 33. projectzero.org
Platform capability
M ic r o s o ft E x c e l
A p a c h e D e rb y 1 0 .3
P r o je c t . Z e r o / W e b S p h e r e . s M a s h IB M
scope DB2
O p e n ID O p e n ID W e b D e v e lo p m e n t O ra c le
p ro vid e r c lie n t E n v iro n m e n t 10g
D o jo C ro s s S it e R e q u e s t M ySQ L
w id g e t F o rg e ry p ro t e c t io n v5
O p e n A ja x
W 3 C iW id g e t H u b 1 .1 D a ta b a s e LD A P
C o n n e c to r
A c t ive C o n t e n t
A dobe
F ilt e rin g
F le x (d e m o ) M S S Q L S e rve r 2 0 0 5
D a ta to
G o o g le g a d g e t
(d e m o )
R E S T fu ll P r o je c t . Z e r o In fo r m i x
A to m W e b S p h e re .s M a s h v1 0 -1 1
D jin n g o & RSS
w id g e t (d e m o ) c o re
JM S
P O P 3 k ic k e r
P O P 3 account
D ire c t o ry M o n ito rin g G ro o v y PHP SO AP
F ile t r a n s fe r t o o l ( e x : ( file k ic k e r )
C o n n e c t io n
C FT or FTP ) R uby e x t e n s io n s
T ru s t A s s o c ia t io n J a va (d e m o )
S M TP
In t e r c e p t o r (o u t b o u n d m a il)
IB M T iv o li
A ccess M anager A s s e m b le
S -F T P
O t h e r S in g le (F T P o ve r S S H )
S ig n -O n t o o ls
FTP
E c li p s e P lu g i n
Copyright 2009 © IBM Corporation
- 34. projectzero.org
What you can do in
projectzero.org
Anonymous Browse the site
Focused on
Visitors can… View Wiki content easy access
Read Forums
Internet web site
Search the Bug Database Free access to the
platform
Read Blogs
Download Binary Drivers*
Registered Post to the Forum Focused on
Users can… Submit Bug Reports feedback
Submit Feature Requests Simple, free
Comment on Blog Posts registration process
Access Source Code*
* Requires acceptance of an IBM license agreement
Copyright 2009 © IBM Corporation
- 35. projectzero.org
How dare you say “Simplified”?
• Convention over configuration
• Loosely coupled by design
– Enables componentization and extensive code reuse
• Application-centric runtime
– No need for a separate application server
• Browser based tooling for both client and server-
side programming
Copyright 2009 © IBM Corporation
- 36. projectzero.org
Outline
• Web 2.0 application requirements?
• Programming language landscape
• Options? Project Zero
• Get started
• Demo
Copyright 2009 © IBM Corporation
- 37. projectzero.org
先决条件
• 操作系统
– Windows®, Linux®, or Mac
• 32-bit Java SE Development Kit (JDK) 5.0
or 6.0
Copyright 2009 © IBM Corporation
- 38. projectzero.org
下载开发者版本
• 包括 WebSphere sMash 1.1 和
AppBuilder
敢于尝鲜的极客们,可以试试下载源代码构
建完整产品
Copyright 2009 © IBM Corporation
参考 : 在Mac机上搭建Projectzero的Build
- 39. projectzero.org
安装
• 保存下载文件(约 2.2MB )
• 解压缩到本地文件系统(如 C:zero )
• 将名为“ zero” 的文件夹加入用户的环境
变量 PATH 中
Copyright 2009 © IBM Corporation
- 40. projectzero.org
确认安装是否成功
打开命令行窗口,输入 zero version
Copyright 2009 © IBM Corporation
- 41. projectzero.org
提供多种工具
• Command-line Interface ( 命令行界面
)
• App Builder
• Plug-ins for Eclipse
在命令行下输入 appbuilder open 打开 AppBuilder
(首次使用请耐心等待 sMash 从网络获取相关模块)
Copyright 2009 © IBM Corporation
- 42. projectzero.org
Best Practices using Project Zero
• 从演示程序开始
– 4 tutorials, 5 samples and 4 demos
• developerWorks 里的 sMash 专区
• 在论坛里提问或求助(中英文皆可)
• 订阅 Project Zero 社区博客
– 中文博客在这里
• Follow twitter: http://
twitter.com/projectzero
Copyright 2009 © IBM Corporation
- 43. projectzero.org
Outline
• Web 2.0 application requirements?
• Programming language landscape
• Options? Project Zero
• Get started
• Demo
Copyright 2009 © IBM Corporation
- 44. projectzero.org
简单联系人管理
• 15 分钟构建数据库驱动的 Web2.0 应用程
序
– Database backend
– REST API
– Dojo based rich user experience
点击这里查看视频录像
Copyright 2009 © IBM Corporation
- 45. projectzero.org
Session Summary
• Understand Web 2.0 application via requirement
analysis
• Look at programming language landscape to
know modern weapons in web developers’
hands
• Know what IBM does for web 2.0 application
development
• How to go through projectzero from beginning
• A cool demo
Copyright 2009 © IBM Corporation
- 46. projectzero.org
The End
• Thanks
• Questions?
Copyright 2009 © IBM Corporation
- 47. projectzero.org
© IBM Corporation 2009. All Rights Reserved.
The workshops, sessions and materials have been prepared by IBM or the session speakers and reflect their own views. They are provided for
informational purposes only, and are neither intended to, nor shall have the effect of being, legal or other guidance or advice to any participant. While
efforts were made to verify the completeness and accuracy of the information contained in this presentation, it is provided AS 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 effect of, creating any warranties or representations from IBM
or its suppliers or licensors, or altering the terms and conditions of the applicable license agreement governing the use of IBM software.
References in this presentation to IBM products, programs, or services do not imply that they will be available in all countries in which IBM operates.
Product release dates and/or capabilities referenced in this presentation may change at any time at IBM’s sole discretion based 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 effect of, stating or implying that any activities undertaken by you will result in any specific sales, revenue
growth or other results.
Performance is based on measurements and projections using standard IBM benchmarks in a controlled environment. The actual throughput 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 configuration, the storage configuration, 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, WebSphere,
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 Infrastructure Library is a registered trademark of the Central Computer and Telecommunications Agency which is now part of the Office of
Government Commerce
Java and all Java-based trademarks are trademarks of Sun Microsystems, Inc. in the United States, other countries, or both.
Microsoft 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 Office of Government Commerce, and is registered in the U.S. Patent
and Trademark Office
Intel and Pentium are trademarks or registered trademarks of Intel Corporation or its subsidiaries in the United States and other 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.
Copyright 2009 © IBM Corporation