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.

What is play

7,841 views

Published on

Playframework meetup in tokyo
held at 08/Oct/2011

Published in: Technology
  • Be the first to comment

What is play

  1. 1. Play! @ikeike443 2011/10/08 Playframework In Tokyo11 10 8
  2. 2. 11 10 8
  3. 3. @ikeike443 Jenkins Playframework11 10 8
  4. 4. Play! @ikeike443 2011/10/08 Playframework In Tokyo11 10 8
  5. 5. Play Play Play2.0 http://www.flickr.com/photos/paulwhaleyphotography/133897626/11 10 8
  6. 6. Play ... Java LL Web Servlet API FW XML FW FW FW11 10 8
  7. 7. 11 10 8
  8. 8. Play!11 10 8
  9. 9. Play Java (Java EE) W3C World Wide Web11 10 8
  10. 10. public class HelloServlet extends HttpServlet { public void doGet (HttpServletRequest req, HttpServletResponse res) { PrintWriter out = res.getWriter(); out.println("Hello, world!"); out.close(); } } <web-app xmlns="http://java.sun.com/xml/ns/j2ee" version="2.4" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http:/java.sun.com/dtd/web-app_2_3.dtd"> <servlet> <servlet-name>hello</servlet-name> <servlet-class>test.HelloServlet</servlet-class> </servlet> <servlet-mapping> <servlet-name>hello</servlet-name> <url-pattern>/hello</url-pattern> </servlet-mapping> </web-app>11 10 8
  11. 11. public class HelloServlet extends HttpServlet { public void doGet (HttpServletRequest req, HttpServletResponse res) { PrintWriter out = res.getWriter(); out.println("Hello, world!"); out.close(); } } <web-app xmlns="http://java.sun.com/xml/ns/j2ee" version="2.4" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http:/java.sun.com/dtd/web-app_2_3.dtd"> <servlet> <servlet-name>hello</servlet-name> <servlet-class>test.HelloServlet</servlet-class> </servlet> <servlet-mapping> <servlet-name>hello</servlet-name> <url-pattern>/hello</url-pattern> </servlet-mapping> </web-app>11 10 8
  12. 12. public class Hello extends Controller { public static void index() { render(“"Hello, world!"”); } }11 10 8
  13. 13. public class Hello extends Controller { public static void index() { render(“"Hello, world!"”); } }11 10 8
  14. 14. Java web Java Play!11 10 8
  15. 15. 11 10 8
  16. 16. 11 10 8
  17. 17. 11 10 8
  18. 18. DB REST API 1011 10 8
  19. 19. 11 10 8
  20. 20. 11 10 8
  21. 21. Servlet XML11 10 8
  22. 22. Play!11 10 8
  23. 23. Play Play Play2.0 http://www.flickr.com/photos/flotaz/2471940678/11 10 8
  24. 24. HTTP I/O11 10 8
  25. 25. Servlet HTTP JPA11 10 8
  26. 26. HTTP XML URL FW Javassist Byte code enhance11 10 8
  27. 27. HTTP Servlet API Strtus Java Web HTTP Java API Web HTTP Play Java web11 10 8
  28. 28. HTTP Servlet API Strtus Java Web HTTP Java API Web HTTP Play Java web11 10 8
  29. 29. Play FW Play HttpSession Controller#session Cookie Memcached11 10 8
  30. 30. Java Web : ? Share Nothing PHP Ruby on Rails Django Web Ajax Web HTTP11 10 8
  31. 31. Java Web : ? Share Nothing PHP Ruby on Rails Django Web Ajax Web HTTP11 10 8
  32. 32. I/O11 10 8
  33. 33. 11 10 8
  34. 34. Netty I/O commons-javaflow Java WebSocket11 10 8
  35. 35. public static void generatePDF(Long reportId) { Promise<InputStream> pdf = new ReportAsPDFJob(report).now(); InputStream pdfStream = await(pdf); renderBinary(pdfStream); } public static void generateLargeCSV() { CSVGenerator generator = new CSVGenerator(); response.contentType = "text/csv"; while(generator.hasMoreData()) { String someCsvData = await(generator.nextDataChunk()); response.writeChunk(someCsvData); } }11 10 8
  36. 36. I/O node.js ... Groovy... http://www.subbu.org/blog/2011/03/nodejs-vs-play-for-front-end-apps11 10 8
  37. 37. 11 10 8
  38. 38. play.lib.F11 10 8
  39. 39. public class AsyncTest extends Controller {   public static void gotchas()   {     params.put("foo", "bar");     renderArgs.put("foo", "bar");     final String foo = "bar";     F.Promise<WS.HttpResponse> remoteCall1 = WS.url("http://some/data/1").getAsync();     F.Promise<WS.HttpResponse> remoteCall2 = WS.url("http://some/data/2").getAsync();     F.Promise<WS.HttpResponse> remoteCall3 = WS.url("http://some/data/3").getAsync();       F.Promise<List<WS.HttpResponse>> promises = F.Promise.waitAll(remoteCall1, remoteCall2, remoteCall3);     await(promises, new F.Action<List<WS.HttpResponse>>() // request suspended here     {       public void invoke(List<WS.HttpResponse> httpResponses)       {         System.out.println(params.get("foo"));         System.out.println(renderArgs.get("foo"));         System.out.println(foo);         render(httpResponses);       }     });     System.out.println("End"); // never called   } }11 10 8
  40. 40. public static void echo() { while(inbound.isOpen()) { WebSocketEvent e = await(inbound.nextEvent()); for(String quit: TextFrame.and(Equals("quit")).match(e)) { outbound.send("Bye!"); disconnect(); } for(String msg: TextFrame.match(e)) { outbound.send("Echo: %s", frame.textData); } for(WebSocketClose closed: SocketClosed.match(e)) { Logger.info("Socket closed!"); } } }11 10 8
  41. 41. 11 10 8
  42. 42. JavaEE …11 10 8
  43. 43. War war11 10 8
  44. 44. 11 10 8
  45. 45. HTTP I/O11 10 8
  46. 46. Play Play Play2.0 http://www.flickr.com/photos/dbrekke/276119940/11 10 8
  47. 47. 11 10 8
  48. 48. 11 10 8
  49. 49. TypeSafe11 10 8
  50. 50. https://twitter.com/#!/jboner/status/6939480804465459311 10 8
  51. 51. 11 10 8
  52. 52. Digg11 10 8
  53. 53. http://about.digg.com/blog/awacs11 10 8
  54. 54. 11 10 8
  55. 55. gurdian.co.uk11 10 8
  56. 56. http://www.infoq.com/articles/guardian_scala11 10 8
  57. 57. 11 10 8
  58. 58. Klout11 10 8
  59. 59. 11 10 8
  60. 60. Play+Scala @_feripera11 10 8
  61. 61. @_felipera11 10 8
  62. 62. @_felipera Accenture (US) Verizon Fannie Mae Freddie Mac Foreclosure.com11 10 8
  63. 63. @_felipera Accenture (US) Verizon Fannie Mae Accenture, Verizon, Fannie Mae, Freddie Freddie Mac Mac, Foreclosure.com. Other places I deployed Play at. Foreclosure.com11 10 8
  64. 64. @_felipera Play, Scala, RabbitMQ, ElasticSearch, Accenture (US) Hadoop, HBase, Oozie, Flume, etc are all part of Klouts stack. Verizon Fannie Mae Accenture, Verizon, Fannie Mae, Freddie Freddie Mac Mac, Foreclosure.com. Other places I deployed Play at. Foreclosure.com11 10 8
  65. 65. Play Play Play2.0 http://www.flickr.com/photos/lwr/168151244/11 10 8
  66. 66. Scala Coffeescript Akka Elastic Search (lucene) MongoDB, Morphia VHost Redis PaaS SASS, SCSS11 10 8
  67. 67. Scala, Akka Scala Play! Akka (Akka support11 10 8
  68. 68. MongoDB, Redis KVS MongoDB, Redis MongoDB Morphia11 10 8
  69. 69. SASS, SCSS CSS SASS, SCSS Play SASS11 10 8
  70. 70. CoffeeScript Javascript Javascript Rails3.111 10 8
  71. 71. Elastic Search (lucene) lucene Simple search lucene11 10 8
  72. 72. VHost Play Virtual Host SaaS11 10 8
  73. 73. Play Play Play2.0 http://www.flickr.com/photos/jim_rafferty_uk/365164119/11 10 8
  74. 74. 2 PaaS11 10 8
  75. 75. Unix, Linux, MacOSX, Windows JDK5 + Python2.6 Win JDK OK11 10 8
  76. 76. PaaS Heroku PlayApps.net Cloudbees Cloudfoundry Google AppEngine DotCloud Amazon Beanstalk11 10 8
  77. 77. PaaS Heroku PlayApps.net Cloudbees Cloudfoundry Google AppEngine DotCloud Amazon Beanstalk11 10 8
  78. 78. PaaS Heroku PlayApps.net Cloudbees Cloudfoundry Google AppEngine DotCloud Amazon Beanstalk11 10 8
  79. 79. PaaS Heroku PlayApps.net Cloudbees Cloudfoundry Google AppEngine war DotCloud Amazon Beanstalk11 10 8
  80. 80. PaaS Heroku PlayApps.net Cloudbees Cloudfoundry Google AppEngine war DotCloud Amazon Beanstalk11 10 8
  81. 81. 1.x Play! http://www.flickr.com/photos/funkimag/5397995349/11 10 8
  82. 82. Play Play Play2.0 http://www.flickr.com/photos/alphadesigner/3833696256/11 10 8
  83. 83. 11 10 8
  84. 84. Scala SBT Python Scala Groovy Akka11 10 8
  85. 85. Preview11 10 8
  86. 86. … Play!11 10 8
  87. 87. 11 10 8

×