Road to Rails

2,438 views

Published on

From the "Rails: Hot or Not?" session at Sioux (Eindhoven, NL, May 23, 2007). An introduction to Rails and programming for the web, targeted at embedded developers. What are the challenges of web development? What technologies do we have at our disposal, and how does Ruby on Rails attack the problem?

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
2,438
On SlideShare
0
From Embeds
0
Number of Embeds
44
Actions
Shares
0
Downloads
0
Comments
0
Likes
0
Embeds 0
No embeds

No notes for slide

Road to Rails

  1. 1. Ruby on Rails Paolo Perrotta
  2. 2. Who we Are, What we Do. Mithun Training & Consulting is a fully independent training and consultancy company, focusing on quality improvement processes and techniques. Mithun Training & Consulting B.V. P.O. Box 898 3800 AW Amersfoort Netherlands T +31 (0)33-457 0840 F +31 (0)33-457 0839 W www.mithun.nl M info@mithun.nl
  3. 3. <Paolo Perrotta>
  4. 4. developer
  5. 5. author
  6. 6. teacher
  7. 7. Ruby on Rails
  8. 8. Rails
  9. 9. RoR
  10. 10. <what is Rails?>
  11. 11. Rails is a framework for building database-backed web applications in Ruby.
  12. 12. Rails is a framework for building database-backed web applications in Ruby.
  13. 13. Rails is a framework for building database-backed web applications in Ruby.
  14. 14. Rails, anyone?
  15. 15. hot or not?
  16. 16. early 2005 first time I heard about Ruby on Rails
  17. 17. <outrageous claims>
  18. 18. “[You] could develop a web application at least ten times faster with Rails than you could with a typical Java framework [...] without making any sacrifices in the quality of your application.” Curt Hibbs
  19. 19. “[You] could develop a web application at least ten times faster with Rails than you could with a typical Java framework [...] without making any sacrifices in the quality of your application.” Curt Hibbs Cust Hibbs is a Senior Soft ware Engineer at Boeing. He was one of the authors of WordStar for Windows.
  20. 20. “Rails is the most well thought-out web development framework I’ve ever used.” James Duncan Davidson
  21. 21. “Rails is the most well thought-out web development framework I’ve ever used.” James Duncan Davidson JDD is the author of Tomcat and Ant.
  22. 22. “Powerful web applications that formerly might have taken weeks or months to develop can be produced in a matter of days [with Rails].” Tim O'Reilly
  23. 23. “Powerful web applications that formerly might have taken weeks or months to develop can be produced in a matter of days [with Rails].” Tim O'Reilly Tim is “that” O’Reilly - the editor.
  24. 24. “Rails has become a standard to which even well- established tools are comparing themselves to.” Martin Fowler
  25. 25. “Rails has become a standard to which even well- established tools are comparing themselves to.” Martin Fowler Author of “Refactoring”.
  26. 26. one more quote...
  27. 27. “Ruby on Rails is astounding. Using it is like watching a kung-fu movie, where a dozen bad-ass frameworks prepare to beat up the little newcomer only to be handed their asses in a variety of imaginative ways.” Nathan Torkington
  28. 28. “Ruby on Rails is astounding. Using it is like watching a kung-fu movie, where a dozen bad-ass frameworks prepare to beat up the little newcomer only to be handed their asses in a variety of imaginative ways.” Nathan Torkington Chairman at OScon
  29. 29. Thanks to Joey deVilla for this picture (http:// accordionguy.blogware.com/ Photos/2006/02/ bruce_on_rails.jpg)
  30. 30. <tonight>
  31. 31. presentation: road to Rails
  32. 32. demo
  33. 33. break
  34. 34. talking (Ruby?) (ActiveRecord?)
  35. 35. talking (Ruby?) (ActiveRecord?)
  36. 36. talking (Ruby?) (ActiveRecord?)
  37. 37. presentation: state of Rails
  38. 38. wrap-up
  39. 39. <road to Rails>
  40. 40. <web development>
  41. 41. why does it matter?
  42. 42. <challenges>
  43. 43. technical
  44. 44. people
  45. 45. <the medium>
  46. 46. unreliable
  47. 47. HTTP
  48. 48. stateless
  49. 49. no memory
  50. 50. no sessions
  51. 51. <the server>
  52. 52. integration
  53. 53. RDBs
  54. 54. Object-Oriented
  55. 55. mismatch
  56. 56. performance
  57. 57. many users
  58. 58. parallel programming
  59. 59. security
  60. 60. abuse
  61. 61. <the client>
  62. 62. the browser
  63. 63. thin client
  64. 64. stupid client
  65. 65. it sucks.
  66. 66. HTML
  67. 67. primitive GUI
  68. 68. constraining
  69. 69. flow
  70. 70. compatibility
  71. 71. many configurations
  72. 72. many browsers
  73. 73. many OSs
  74. 74. many devices
  75. 75. <the process>
  76. 76. quick
  77. 77. continuous feedback
  78. 78. moving target
  79. 79. <technologies>
  80. 80. static
  81. 81. just pages
  82. 82. forms
  83. 83. CGI
  84. 84. C
  85. 85. Perl
  86. 86. not secure
  87. 87. slow
  88. 88. web languages
  89. 89. ASP
  90. 90. PHP
  91. 91. template
  92. 92. HTML+code
  93. 93. <? $db = quot;DATABASE NAMEquot;; $admin = quot;MYSQL USER NAMEquot;; $adpass = quot;MYSQL PASSWORDquot;; $mysql_link = mysql_connect(quot;localhostquot;, $admin, $adpass); mysql_select_db($db, $mysql_link); ?> <HTML> <BODY> <script language=quot;phpquot;> if($react == quot;delete_userquot;) { if($user) { $query = quot;DELETE from login WHERE user='$user' quot;; $result = mysql_query($query, $mysql_link); if(mysql_num_rows($result)) { print(quot;<strong>$user</strong> successfully deleted<p>quot;); } } else { print(quot;<strong>no users to delete yet.</strong><p>quot;); } } </script> <form method=quot;POSTquot; action=quot;admin.php3quot;><div align=quot;centerquot;><center><p>Delete Users <input type=quot;hiddenquot; name=quot;reactquot; value=quot;delete_userquot;> <select name=quot;userquot; size=quot;1quot;> <script language=quot;phpquot;> $query = quot;SELECT user FROM login ORDER BY userquot;; $result = mysql_query($query, $mysql_link); ...
  94. 94. <? $db = quot;DATABASE NAMEquot;; $admin = quot;MYSQL USER NAMEquot;; $adpass = quot;MYSQL PASSWORDquot;; $mysql_link = mysql_connect(quot;localhostquot;, $admin, $adpass); mysql_select_db($db, $mysql_link); ?> <HTML> <BODY> <script language=quot;phpquot;> if($react == quot;delete_userquot;) { if($user) { $query = quot;DELETE from login WHERE user='$user' quot;; $result = mysql_query($query, $mysql_link); if(mysql_num_rows($result)) { print(quot;<strong>$user</strong> successfully deleted<p>quot;); } } else { print(quot;<strong>no users to delete yet.</strong><p>quot;); } } </script> <form method=quot;POSTquot; action=quot;admin.php3quot;><div align=quot;centerquot;><center><p>Delete Users <input type=quot;hiddenquot; name=quot;reactquot; value=quot;delete_userquot;> <select name=quot;userquot; size=quot;1quot;> <script language=quot;phpquot;> $query = quot;SELECT user FROM login ORDER BY userquot;; $result = mysql_query($query, $mysql_link); ...
  95. 95. <? $db = quot;DATABASE NAMEquot;; $admin = quot;MYSQL USER NAMEquot;; $adpass = quot;MYSQL PASSWORDquot;; $mysql_link = mysql_connect(quot;localhostquot;, $admin, $adpass); mysql_select_db($db, $mysql_link); ?> <HTML> <BODY> <script language=quot;phpquot;> if($react == quot;delete_userquot;) { if($user) { $query = quot;DELETE from login WHERE user='$user' quot;; $result = mysql_query($query, $mysql_link); if(mysql_num_rows($result)) { print(quot;<strong>$user</strong> successfully deleted<p>quot;); } } else { print(quot;<strong>no users to delete yet.</strong><p>quot;); } } </script> <form method=quot;POSTquot; action=quot;admin.php3quot;><div align=quot;centerquot;><center><p>Delete Users <input type=quot;hiddenquot; name=quot;reactquot; value=quot;delete_userquot;> <select name=quot;userquot; size=quot;1quot;> <script language=quot;phpquot;> $query = quot;SELECT user FROM login ORDER BY userquot;; $result = mysql_query($query, $mysql_link); ...
  96. 96. <? $db = quot;DATABASE NAMEquot;; $admin = quot;MYSQL USER NAMEquot;; $adpass = quot;MYSQL PASSWORDquot;; $mysql_link = mysql_connect(quot;localhostquot;, $admin, $adpass); mysql_select_db($db, $mysql_link); ?> <HTML> <BODY> <script language=quot;phpquot;> if($react == quot;delete_userquot;) { if($user) { $query = quot;DELETE from login WHERE user='$user' quot;; $result = mysql_query($query, $mysql_link); if(mysql_num_rows($result)) { print(quot;<strong>$user</strong> successfully deleted<p>quot;); } } else { print(quot;<strong>no users to delete yet.</strong><p>quot;); } } </script> <form method=quot;POSTquot; action=quot;admin.php3quot;><div align=quot;centerquot;><center><p>Delete Users <input type=quot;hiddenquot; name=quot;reactquot; value=quot;delete_userquot;> <select name=quot;userquot; size=quot;1quot;> <script language=quot;phpquot;> $query = quot;SELECT user FROM login ORDER BY userquot;; $result = mysql_query($query, $mysql_link); ...
  97. 97. tm Big Ball of Mud
  98. 98. Java
  99. 99. J2EE
  100. 100. JSP
  101. 101. many frameworks
  102. 102. Struts
  103. 103. many layers
  104. 104. complex
  105. 105. bloated
  106. 106. XML configuration
  107. 107. <?xml version=quot;1.0quot;?> <!DOCTYPE ejb-jar PUBLIC '-//Sun Microsystems, Inc.//DTD Enterprise JavaBeans 1.1//EN' 'http://java.sun.com/j2ee/dtds/ejb-jar_1_1.dtd'> <ejb-jar> <enterprise-beans> <!-- A minimal session EJB deployment --> <session> <ejb-name>PostingEJB</ejb-name> <home>ejbs.PostingHome</home> <remote>ejbs.Posting</remote> <ejb-class>ejbs.PostingBean</ejb-class> <!-- or Stateless --> <session-type>Stateful</session-type> <transaction-type>Container</transaction-type> </session> <!-- A minimal CMP entity EJB deployment --> <entity> <ejb-name>Bid</ejb-name> <home>ejbe.BidHome</home> <remote>ejbe.Bid</remote> <ejb-class>ejbe.BidBean</ejb-class> <persistence-type>Container</persistence-type> <prim-key-class>ejbe.BidPK</prim-key-class> <reentrant>False</reentrant> <cmp-field><field-name>bid</field-name></cmp-field> <cmp-field><field-name>bidder</field-name></cmp-field> <cmp-field><field-name>bidDate</field-name></cmp-field> <cmp-field><field-name>id</field-name></cmp-field> </entity> <!-- A minimal BMP entity EJB deployment --> <entity> <ejb-name>BidBMP</ejb-name> ...
  108. 108. the client side
  109. 109. Java applets
  110. 110. ActiveX
  111. 111. Flash
  112. 112. JavaScript
  113. 113. XMLHttpRequest
  114. 114. asynchronous
  115. 115. AJAX
  116. 116. better GUIs
  117. 117. difficult
  118. 118. <state of the art>
  119. 119. on the server
  120. 120. J2EE (or C#)
  121. 121. enterprisey
  122. 122. PHP
  123. 123. bigballofmuddy
  124. 124. on the client
  125. 125. AJAX
  126. 126. clumsy
  127. 127. not really great
  128. 128. anything better?
  129. 129. Rails
  130. 130. <the Rails Way>
  131. 131. I
  132. 132. KISS
  133. 133. Keep It Simple (Stupid)
  134. 134. Keep It Simple (Stupid)
  135. 135. II
  136. 136. DRY
  137. 137. Don’t Repeat Yourself
  138. 138. III
  139. 139. Convention over Configuration
  140. 140. Convention over Configuration
  141. 141. I - KISS II - DRY III - CoC
  142. 142. <demo>
  143. 143. <break>
  144. 144. <talk>

×