100311 Dev Fest2010

1,401 views

Published on

Published in: Technology
0 Comments
0 Likes
Statistics
Notes
  • Be the first to comment

  • Be the first to like this

No Downloads
Views
Total views
1,401
On SlideShare
0
From Embeds
0
Number of Embeds
2
Actions
Shares
0
Downloads
8
Comments
0
Likes
0
Embeds 0
No embeds

No notes for slide

100311 Dev Fest2010

  1. 1. 5分でできる、html5CRUDappl.Web Messaging rpcmeets Ruby on Rails♪<br />2010.3.11(thu) Google DevFest 2010<br />小松 けんさく(こまっしゅ)<br />http://twitter.com/komasshu<br />
  2. 2. 自己紹介<br />勤務先:NTT Communications Corp.<br />Community : html5-developers-jp<br />Web SQL Database<br />Web Sockets<br />…<br />
  3. 3. “Web Workersは、革命だ”<br />ShumpeiShiraishi<br />(2010.2.19 @ developer’s summit 2010)<br />
  4. 4. Web Messaging rpc<br />http://www.slideshare.net/shumpei/html5-web-messagingweb<br />
  5. 5. fine♪<br />
  6. 6. 調べてみた<br />http://code.google.com/p/web-messaging-rpc/<br />
  7. 7. Great!!<br />
  8. 8. Bye-bye spaghetti!!<br />
  9. 9. あまりにも感動したので・・<br />
  10. 10. コミッターになりましたww<br />
  11. 11. はじめの一歩<br />
  12. 12. Railsに組み込んでみました。<br />Html5<br />(web messaging rpc)<br />Ruby on Rails<br />UI<br />layer<br />BL<br />layer<br />Action<br />Controller<br />Active<br />Record<br />Create<br />Retrieve<br />DB<br />Update<br />Delete<br />Html5 meets Rails!!<br />
  13. 13. 早速Demoww<br />
  14. 14. これだけ恐るべし WMR + Rails<br />$ rails sample<br />$ cd sample<br />$ mkdir lib/generators<br />$ cp -r ../wmr_komasshold lib/generators/<br />$ ruby script/generate wmr_komassholdbookservicetitle:stringprice:integerauthor:string<br />$ rake db:migrate<br />$ ruby script/server<br />
  15. 15. BL層(Worker)のコードはこんな感じno postmessage & onmessage<br />importScripts("/javascripts/webrpc.js");<br />new webrpc.Service("model", {<br /> find: function(obj) { // Retrieve<br />varreq = new XMLHttpRequest();<br />req.open("GET", "/"+obj.plural+".json", false);<br />recv = req.send(); <br />if(req.status == 200)<br /> return eval("("+req.responseText+")");<br /> else<br /> return null;<br /> },<br />
  16. 16. 今週末commit予定よろしければ試してみて下さい<br />http://code.google.com/p/web-messaging-rpc/<br />

×