Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.

Simplified Web2.0 application development with Project Zero


Published on

为中国科学院研究生提供的 Web2.0 系列讲座之一,概括介绍了 Project Zero 社区为简化开发 Web 2.0 应用程序所提供的技术和工具。

Published in: Technology
  • Be the first to comment

Simplified Web2.0 application development with Project Zero

  1. 1. Simplified Web 2.0 application development with Project Zero 朱可 软件工程师 IBM 中国开发实验室新技术中心 Web 2.0 Copyright 2009 © IBM Corporation
  2. 2. Outline • Web 2.0 application requirements? • Programming language landscape • Options? Project Zero • Get started • Demo Copyright 2009 © IBM Corporation
  3. 3. 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. 4. Outline • Web 2.0 application requirements? • Programming language landscape • Options? Project Zero • Get started • Demo Copyright 2009 © IBM Corporation
  5. 5. So Many Web 2.0 Applications Copyright 2009 © IBM Corporation
  6. 6. Take One Pretty Example 搜索服务 天气预报 相册照片 电子邮件收件箱 日历 Copyright 2009 © IBM Corporation Twitter 工具
  7. 7. Open Standards Copyright 2009 © IBM Corporation
  8. 8. 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. 9. 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. 10. Trends Web 1.0 Web 2.0 ? 价值来源 中心化 去中心化 去中心化 反馈循环周期 月、周 天、分钟 天、分钟 交互模型 请求、响应 Rich user experience 自发、自治 产品 难以复制的数据 数据生态系统 核心战略资产 发布者进行发布 数据生成方式 用户可以贡献内容 数据本身的语义 “ 占地盘” 有效的增长方式 网络效应 “ 新陈代谢” 统一模式或分类 数据结构 大众分类 隐含的元数据 竞争 资源分配方式 用户参与 开放供应链 信息发布者 最重要的数据来源 大规模人群 环境 Copyright 2009 © IBM Corporation
  11. 11. Common Themes In Web2.0 • Massive amounts data • Rich user experience • Application is growing • Time to value • Flexibility • Security Copyright 2009 © IBM Corporation
  12. 12. Outline • Web 2.0 application requirements? • Programming language landscape • Options? Project Zero • Get started • Demo Copyright 2009 © IBM Corporation
  13. 13. 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. 14. 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. 15. How? Read Books Copyright 2009 © IBM Corporation
  16. 16. Which programming languages works with AJAX? source: survey “State of the Web 2008” (January 9th, 2009) web-2008 Copyright 2009 © IBM Corporation
  17. 17. 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. 18. 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. 19. 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 def number=0 // list a file with line numbers new File ('test.groovy').eachLine { line -> number++ println "$number: $line" } Copyright 2009 © IBM Corporation
  20. 20. Outline • Web 2.0 application requirements? • Programming language landscape • Options? • Get started • Demo Copyright 2009 © IBM Corporation
  21. 21. 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 Copyright 2009 © IBM Corporation
  22. 22. Copyright 2009 © IBM Corporation
  23. 23. 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
  24. 24. Lower Skill Required than Java EE Copyright 2009 © IBM Corporation
  25. 25. 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. 26. PHP Support • PHP runtime built in Java – To 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. 27. 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. 28. 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. 29. 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. 30. 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. 31. 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. 32. Social Capacity • Application life cycle management – Command Line – REST API – Administration tool Copyright 2009 © IBM Corporation
  33. 33. 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. 34. What you can do in 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. 35. 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. 36. Outline • Web 2.0 application requirements? • Programming language landscape • Options? Project Zero • Get started • Demo Copyright 2009 © IBM Corporation
  37. 37. 先决条件 • 操作系统 – Windows®, Linux®, or Mac • 32-bit Java SE Development Kit (JDK) 5.0 or 6.0 Copyright 2009 © IBM Corporation
  38. 38. 下载开发者版本 • 包括 WebSphere sMash 1.1 和 AppBuilder 敢于尝鲜的极客们,可以试试下载源代码构 建完整产品 Copyright 2009 © IBM Corporation 参考 : 在Mac机上搭建Projectzero的Build
  39. 39. 安装 • 保存下载文件(约 2.2MB ) • 解压缩到本地文件系统(如 C:zero ) • 将名为“ zero” 的文件夹加入用户的环境 变量 PATH 中 Copyright 2009 © IBM Corporation
  40. 40. 确认安装是否成功 打开命令行窗口,输入 zero version Copyright 2009 © IBM Corporation
  41. 41. 提供多种工具 • Command-line Interface ( 命令行界面 ) • App Builder • Plug-ins for Eclipse 在命令行下输入 appbuilder open 打开 AppBuilder (首次使用请耐心等待 sMash 从网络获取相关模块) Copyright 2009 © IBM Corporation
  42. 42. Best Practices using Project Zero • 从演示程序开始 – 4 tutorials, 5 samples and 4 demos • developerWorks 里的 sMash 专区 • 在论坛里提问或求助(中英文皆可) • 订阅 Project Zero 社区博客 – 中文博客在这里 • Follow twitter: http:// Copyright 2009 © IBM Corporation
  43. 43. Outline • Web 2.0 application requirements? • Programming language landscape • Options? Project Zero • Get started • Demo Copyright 2009 © IBM Corporation
  44. 44. 简单联系人管理 • 15 分钟构建数据库驱动的 Web2.0 应用程 序 – Database backend – REST API – Dojo based rich user experience 点击这里查看视频录像 Copyright 2009 © IBM Corporation
  45. 45. 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. 46. The End • Thanks • Questions? Copyright 2009 © IBM Corporation
  47. 47. © 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: 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 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