ProjectZero Web Oriented Architecture? Enterprise 2.0 ProjectZero XML Web2.0 SOA Disclaimer IBM
Agenda Ruby on Rails ProjectZero Enterprise Full stack framework Ruby on rails Ruby / Java / Groovy / PHP / Python / O/R Mapping Data Mapper / Row Data Gateway / Table Data Gateway / Active Record Convention over Configuration Convention( ) / Configuration( ) / DOA DOA YAML / XML Architectural decision Install gems install / install
Ruby Duck typing Open class instruction = "p 'hello cracked world' eval(instruction) // hello cracked world? JCP (Java Community Process)?
Java import java.util.date; Date today = new Date(); Groovy today = new Date() : Java, Groovy, Ruby = Java Java Ruby Ruby require date today = Date.new Boiler plate = Java import java.util.*; public class Date1 { public static void main(string[] args) { Date today = new Date(); System.out.println(today); // Mon Apr 21 08:15:38 JST 2008 Groovy today = new Date() ( Top level statement ) println today // Mon Apr 21 08:23:35 JST 2008
Closure 1,2,3,4,5 Ruby p [1,2,3,4,5].select { i i%2==0 // [2, 4] Groovy println ([1,2,3,4,5].findAll {it%2==0 ) // [2, 4] (find)+ (All) Java it : Foo = Bar = optional typing class TypeSafeTest { static void main(args) { Foo f = new Foo() f.age = "taro" Bar b = new Bar() b.age = "hanako" println f.age println b.age class Foo { def name def age class Bar{ String name int age Groovy Bean : JavaBean Groovy Int def Object
Groovy,Java Groovy ( ) class Hello { static void main(args) { println Hello" World wd = new World() wd.greet( Groovy! ") Java ( ) public class World { public void greet(string arg) { System.out.println("world + arg); ScriptEngimeManager World Java : Hello world Groovy! O/R Mapping Employees Employee String name VARCHAR name int salary INTEGER salary Employees Employee DOA def name def salary VARCHAR name INTEGER salary
Ruby Groovy Java JSR241 Java Enterprise VM JVM Linux, AIX, Windows, zlinux, iseries Optional typing : Duck typing :
Security HTTPS WS-Security Active Content Filtering Cookie LTPAToken2 (Light weight Third Party Authentication) Cookie (Beta) Active Content Filtering http://www.ibm.com/developerworks/jp/web/library/wa-pz-acf/
O/R Mapping O/R Mapping Active Record 1 CRUD Table Data Gateway 1 Finder Row Data Gateway Finder Data Mapper Mapper PofEAA Pattern of Enterpirse Aplicaiton Arhitecture
ActiveRecord Person lastname firstname numberofdependents insert Update getpayment DB TransactionScript Row data gateway, Table data gateway 2 A B Aservice getaccount() sendmoney() Bservice getaccount() receivemoney()
DataMapper Mapper Person lastname firstname numberofdependents getpayment Person Mapper insert Update delete Mapper O/R Mapping Active Record DB DOA Mapper O/R Mapping Zero resource model? ( )
Zero ZRM - JavaScript + dojo Database DOA(Data ) JavaSE (JavaEE ) Project Zero RESTful HTTP API JSON or ATOM Collection HTTP ZRM API Java SE SQL DB Convention over Configuration
Convention public app/resources app/errors app/scripts app/views config/ivy.xml config/zero.config logs Web ( ) RESTful (..groovy) (.html) (.groovy,.gt) (.gt) *.gt = Groovy Template zero.config (zero) database.yml (RoR) Zero (ZRM) DB ZRM Apache Derby DB DB zero.config /config/db/zero-resource = { "class" : "org.apache.derby.jdbc.embeddeddatasource", "databasename" : "db/resource", "createdatabase" : "create" DB zero.config /config/resource/dbkey = "my-database"
SOA + RESTful / /Web RESTful Light-weight Web System Script REST ATOM OpenID RSS Situational App Enterprise SOA Enterprise System Java EE WS-* Web Oriented Architecture QoS RESTful SOA Enterprise Web 2.0 WebSphere smash (Project Zero) Mission Critical
RESTful SOA : HTTP (SOAP over JMS ) : JSON, ATOM, XML : AJAX : GET, PUT, POST, DELETE : HTTPS + WS-Security +Web 55 M 13 M 3 M US Bureau of Labor Statistics Estimate for US - 2012 http://www.cs.cmu.edu/~cscaffid/papers/eu_20050923_vlhcc.ppt Those using computers at work who can automate business tasks that are not already addressed (e.g. working with databases and dynamic spreadsheets). Shielded from integration issues. Web Service consumers. Those using computers at work who say that they program Focused on empowering the Assemblers. Web Developers with skills for content integration and app logic. UI and Content Manipulation Skills Spreadsheets, Databases, Wikis, Blogs, Web Content Management Web Development. Skills for content integration and application logic. PHP, ASP, Ruby on Rails, JavaScript, HTML, XML, REST + OSS App Server + web Creating services, wrapping services Skills for backend Deploying these applications. Discovery of feeds & Integration and services, mgmt of the environment, etc. Infrastructure. IT Professionals who are professional application programmers. J2EE,.NET 1M are sophisticated professional application programmers, 2M are less sophisticated App Server +
Zero Prototype.js dojo toolkit Ruby Groovy + PHP Web Enterprise 1JVM = n ( ) JVM WOA (Web Oriented Architecture) SOA Web www.projectzero.org Wiki
Forum Assembler XML
Groovy DSL: Flow builder def flow() { def builder = new FlowBuilder(writer); builder.process( name:"feedgroovyexample") { receiveget( name:"rssrcv") feed( name:"yahoofeed", url:"http://rss.news.yahoo.com/rss/topstories") { control( source:"rssrcv") feed( name:"cnnfeed", url:"http://rss.cnn.com/rss/cnn_topstories.rss") { control( source:"rssrcv") aggregatefeeds( name:"aggregate" ) { input( value: '${YahooFeed') input( value: '${CNNFeed') sortfeed( name:"sort", orderby:"-title") { input( value: '${aggregate') replyget( name:"rssrply") { input( value: '${sort' ) Groovy Builder Flow DSL Flow Flow Global Context Event Handler _receiveget on_receiveget() { _exchangerate _replyget Event Engine on_exchangerate() { on_replyget() {
Flow Flow XML(Flow Language) or Flow Editor Groovy(Flow DSL) Flow GUI Flow Groovy XML <approot> + config +ivy.xml + Zero Resolve Library 1. 2. Ivy 5. Implementation spring apache-ds commons-http commons-lang commons-io 3. 4. -smash- zero. assemble.flow dojo zero.wbtools zero.data -Maven- Apache Ivy project ( )
Web SOA + Enterprise SOA Browser Client Platform Portal.0 Aggregation Navigation Customization Client Programming Model Declarative MVC Patterns Unleash Zero Services Ajax/Dojo REST Zero Content Login Tagging Template Core Engine Event Ratings Portal Services user prefs fragments pages Protocols & Formats Atom RSS Pub/Sub Captchas Bookmark Snippets Context Polling Validation JSON Weblog Wiki Search Calico XML Patterns Data Zero Common Runtime (PHP, Java, JavaScript) Enterprise SOA DB2 Legacy CICS IMS WPS, ESB, Portal App Server WAS, CE, Tomcat J2EE Management, Security, QoS SOA SOA OrderService +getallorders() +updateorderlist() +addneworder() +getorderdetail() +isordervalid() : CustomerService +getcustomers() +getcustomer() +addcustomer() +updatecustomer() +deletecustomer() : Web2.0 Web2.0 <<Interface>> Resource GET PUT POST DELETE /orders/ GET list all orders PUT N/A POST add a new order DELETE cancel all orders /orders/{id GET get order detail PUT update order POST add item DELETE cancel order /customers/ GET list all customers PUT N/A POST add a new customer DELETE delete all customers /customers/{id GET get all orders fro customer PUT update customer POST add order DELETE cancel all customer orders /customers/{id/orders/ GET get all orders for customer PUT N/A 4 POST add order (URI) DELETE cancel all customer orders
REST GET http://shop.com/ GET result POST http//shop.com/? =A& =1 A B POST http//shop.com/? =B& =1 POST http//shop.com/? ( ) ( ) DB REST Client-Server : 2 HTTPS JSON Schema validate (1 )
Database O/R Mapper Web SOA( ) ProjectZero JSON SOAP, Business Object HTTP JMS REST Business Object Verb( ) Web (Yahoo pipes ) Eclipse Wiki Etc
Web HTTP JSON Web2.0 SOA www.projectzero.org Wiki CDCD : Radical simplification Ruby,PHP Groovy + PHP Web (Wiki ) Gems, CPAN, PEAR ProjectZero REST( ) (beta) ProjectZero + smash ( ) HTTPS Same origin policy DRY CoC Java Eclipse Ivy install DRY CoC Enterprise HTTP JMS MQ FTP XML (Business Object) SI WS-Security ESB