Your SlideShare is downloading. ×
0
Atlrug   intermodal - sep 2011
Atlrug   intermodal - sep 2011
Atlrug   intermodal - sep 2011
Atlrug   intermodal - sep 2011
Atlrug   intermodal - sep 2011
Atlrug   intermodal - sep 2011
Atlrug   intermodal - sep 2011
Atlrug   intermodal - sep 2011
Atlrug   intermodal - sep 2011
Atlrug   intermodal - sep 2011
Atlrug   intermodal - sep 2011
Atlrug   intermodal - sep 2011
Atlrug   intermodal - sep 2011
Atlrug   intermodal - sep 2011
Atlrug   intermodal - sep 2011
Atlrug   intermodal - sep 2011
Atlrug   intermodal - sep 2011
Atlrug   intermodal - sep 2011
Atlrug   intermodal - sep 2011
Atlrug   intermodal - sep 2011
Atlrug   intermodal - sep 2011
Atlrug   intermodal - sep 2011
Atlrug   intermodal - sep 2011
Atlrug   intermodal - sep 2011
Atlrug   intermodal - sep 2011
Atlrug   intermodal - sep 2011
Atlrug   intermodal - sep 2011
Atlrug   intermodal - sep 2011
Atlrug   intermodal - sep 2011
Atlrug   intermodal - sep 2011
Atlrug   intermodal - sep 2011
Atlrug   intermodal - sep 2011
Atlrug   intermodal - sep 2011
Atlrug   intermodal - sep 2011
Atlrug   intermodal - sep 2011
Atlrug   intermodal - sep 2011
Atlrug   intermodal - sep 2011
Atlrug   intermodal - sep 2011
Atlrug   intermodal - sep 2011
Atlrug   intermodal - sep 2011
Atlrug   intermodal - sep 2011
Atlrug   intermodal - sep 2011
Atlrug   intermodal - sep 2011
Atlrug   intermodal - sep 2011
Atlrug   intermodal - sep 2011
Atlrug   intermodal - sep 2011
Atlrug   intermodal - sep 2011
Atlrug   intermodal - sep 2011
Atlrug   intermodal - sep 2011
Atlrug   intermodal - sep 2011
Atlrug   intermodal - sep 2011
Atlrug   intermodal - sep 2011
Atlrug   intermodal - sep 2011
Atlrug   intermodal - sep 2011
Atlrug   intermodal - sep 2011
Atlrug   intermodal - sep 2011
Atlrug   intermodal - sep 2011
Atlrug   intermodal - sep 2011
Atlrug   intermodal - sep 2011
Atlrug   intermodal - sep 2011
Atlrug   intermodal - sep 2011
Atlrug   intermodal - sep 2011
Atlrug   intermodal - sep 2011
Atlrug   intermodal - sep 2011
Atlrug   intermodal - sep 2011
Atlrug   intermodal - sep 2011
Atlrug   intermodal - sep 2011
Atlrug   intermodal - sep 2011
Atlrug   intermodal - sep 2011
Atlrug   intermodal - sep 2011
Atlrug   intermodal - sep 2011
Atlrug   intermodal - sep 2011
Atlrug   intermodal - sep 2011
Atlrug   intermodal - sep 2011
Atlrug   intermodal - sep 2011
Atlrug   intermodal - sep 2011
Atlrug   intermodal - sep 2011
Upcoming SlideShare
Loading in...5
×

Thanks for flagging this SlideShare!

Oops! An error has occurred.

×
Saving this for later? Get the SlideShare app to save on your phone or tablet. Read anywhere, anytime – even offline.
Text the download link to your phone
Standard text messaging rates apply

Atlrug intermodal - sep 2011

375

Published on

Presentation at the Atlanta Ruby User's Group, Sep 2011 for the Intermodal Gem (http://github.com/hosh/intermodal)

Presentation at the Atlanta Ruby User's Group, Sep 2011 for the Intermodal Gem (http://github.com/hosh/intermodal)

Published in: Technology, Business
0 Comments
1 Like
Statistics
Notes
  • Be the first to comment

No Downloads
Views
Total Views
375
On Slideshare
0
From Embeds
0
Number of Embeds
0
Actions
Shares
0
Downloads
0
Comments
0
Likes
1
Embeds 0
No embeds

Report content
Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
No notes for slide
  • Working with Rails since 2006Started in the days of Rails 1.0Seen a lot of innovations, out-innovating PHP, .NET and JavaBut now, Rails community stopped innovating.
  • Why did Rails stop innovating?Because we’re not looking outside of Rails.
  • Here’s the biggest change
  • -Big implications. -We’re all getting old-What do you see in your head when you see this word?
  • Monitor- Mouse- Keyboard
  • Macbook Air- Monitor Mouse Keyboard
  • Here’s the biggest change
  • - The kids growing up right now sees this word, they think of--
  • Smartphone
  • Tablet
  • Wallboard
  • - The kids growing up right now sees this word, they think of--
  • Laptop
  • - The kids growing up right now sees this word, they think of--
  • Mobile Web
  • - The kids growing up right now sees this word, they think of--
  • What glues all the clients together?
  • What glues all the clients together?
  • Write the API first.
  • What glues all the clients together?
  • What glues all the clients together?
  • What glues all the clients together?
  • What glues all the clients together?
  • What glues all the clients together?
  • What glues all the clients together?
  • What glues all the clients together?
  • What glues all the clients together?
  • What glues all the clients together?
  • What glues all the clients together?
  • What glues all the clients together?
  • What glues all the clients together?
  • What glues all the clients together?
  • What glues all the clients together?
  • What glues all the clients together?
  • What glues all the clients together?
  • That’s why it is called Open Source.Welcome users or contributors.
  • Working with Rails since 2006Started in the days of Rails 1.0Seen a lot of innovations, out-innovating PHP, .NET and JavaBut now, Rails community stopped innovating.
  • Transcript

    • 1. Intermodal<br />
    • 2. Ho-Sheng Hsiao<br />Github: github.com/hosh<br />Twitter: hosheng<br />
    • 3. Rails Stopped Innovating<br />
    • 4. 500,000 Android Activated<br />per day<br />Source: bit.ly/500k-android-activtions<br />
    • 5. Computer<br />
    • 6.
    • 7.
    • 8. 500,000 Android Activated<br />per day<br />Source: bit.ly/500k-android-activtions<br />
    • 9. Computer<br />
    • 10.
    • 11.
    • 12.
    • 13. Rails Stopped Innovating<br />
    • 14. Web<br />
    • 15.
    • 16. Web<br />
    • 17.
    • 18. Platforms<br />iOS<br />Android<br />Blackberry<br />Windows 8<br />HP/Palm WebOS<br />
    • 19. Cross Platform<br />jQuery Mobile<br />Sencha<br />Backbone.js<br />Spine.js<br />PhoneGap<br />Titanium<br />
    • 20. Rails?<br />
    • 21. API<br />
    • 22. API=Machine Legibility<br />
    • 23. Write the API First<br />
    • 24. Write the API First<br />No Server-Side HTML<br />
    • 25. Write the API First<br />No Templates<br />
    • 26. Write the API First<br />Just Endpoints<br />
    • 27. Write the API First<br />REST<br />
    • 28. RESTful Endpoints<br />RESTful<br />CRUD<br />
    • 29. RESTful Endpoints<br />Create<br />Read<br />Update<br />Delete<br /><ul><li> POST /posts.json
    • 30. GET /posts/1.json
    • 31. PUT /posts/1.json
    • 32. DELETE /posts/1.json
    • 33. GET /posts.json</li></li></ul><li>RESTful Endpoints<br />Create<br />Read<br />Update<br />Delete<br /><ul><li> POST /authors.json
    • 34. GET /authors/1.json
    • 35. PUT /authors/1.json
    • 36. DELETE /authors/1.json
    • 37. GET /authors.json</li></li></ul><li>See the pattern?<br />
    • 38. resources :postsresources :authors<br />
    • 39. <ul><li> POST /posts.json
    • 40. GET /posts/1.json
    • 41. PUT /posts/1.json
    • 42. DELETE /posts/1.json
    • 43. GET /posts.json</li></li></ul><li><ul><li> POST /authors.json
    • 44. GET /authors/1.json
    • 45. PUT /authors/1.json
    • 46. DELETE /authors/1.json
    • 47. GET /authors.json</li></li></ul><li>Intermodal<br />
    • 48. Intermodal<br />DSL for API<br />
    • 49. Intermodal<br />Not Scaffolding<br />
    • 50. Intermodal<br />Three <br />Common Patterns<br />
    • 51. Intermodal<br />Resources<br />
    • 52. resources :posts<br />
    • 53. <ul><li> POST /posts.json
    • 54. GET /posts/1.json
    • 55. PUT /posts/1.json
    • 56. DELETE /posts/1.json
    • 57. GET /posts.json</li></li></ul><li>Intermodal<br />Nested Resources<br />
    • 58. # One-to-Many# Post has_many :comments# Comment belongs_to :postnested_resources:post, :comments<br />
    • 59. <ul><li> POST /posts/1/comments.json
    • 60. GET /posts/1/comments/1.json
    • 61. PUT /posts/1/comments/1.json
    • 62. DELETE /posts/1/comments/1.json
    • 63. GET /posts/1/comments.json</li></li></ul><li>Intermodal<br />Linking Resources<br />
    • 64. # Many-to-Many# Post has_many :authors # :through => :contributions# Author has_many :posts# :through => :contributionslink_resources_from:post, :to =>:authors<br />
    • 65. <ul><li> POST /posts/1/authors.json
    • 66. GET /posts/1/authors.json
    • 67. PUT /posts/1/authors.json
    • 68. DELETE /posts/1/authors.json</li></li></ul><li>Intermodal<br />Presenters<br />
    • 69. presentation_for:postsdo presents :id presents :title presents :content presents :authors => ->(p) { p.authors.map(&:id) }end<br />
    • 70. JSON<br />
    • 71. { “post”: { “id”: 1, “title”: “Hello World”, “content”: “Best of Times, Worst of Times”, “authors”: [1,2,3] }}<br />
    • 72. XML<br />
    • 73. <post> <id>1</id> <title>1</title> <content>Best of Times, Worst of Times</content> <authors> <author>1</author> <author>2</author> <author>3</author> </authors></post><br />
    • 74. Intermodal<br />Acceptors<br />
    • 75. acceptance_for:postsdo accepts :title accepts :contentend<br />
    • 76. acceptance_for:postsdo accepts :title accepts :contentend# Does not accept :id# Does not accept :authors<br />
    • 77. acceptance_for:postsdo accepts :title accepts :contentend# Passes only :title and :content# from params to#Post#update_attributes<br />
    • 78. Intermodal<br />Testing<br />
    • 79. Intermodal<br />Test the API<br />Not the Controller<br />
    • 80. Intermodal<br />Send <br />Rack Request<br />
    • 81. <ul><li> POST /posts.json
    • 82. GET /posts/1.json
    • 83. PUT /posts/1.json
    • 84. DELETE /posts/1.json
    • 85. GET /posts.json</li></li></ul><li>Intermodal<br />ExpectRack Response<br />
    • 86. <ul><li> POST /posts.json 201 Created
    • 87. GET /posts/1.json 200 OK
    • 88. PUT /posts/1.json 200 OK
    • 89. DELETE /posts/1.json 200 OK
    • 90. GET /posts.json 200 OK</li></li></ul><li><ul><li> POST /posts.json utf8 json
    • 91. GET /posts/1.json utf8 json
    • 92. PUT /posts/1.json utf8 json
    • 93. DELETE /posts/1.json utf8 json
    • 94. GET /posts.json utf8 json</li></li></ul><li><ul><li> POST /posts.json Create
    • 95. GET /posts/1.json Read
    • 96. PUT /posts/1.json Update
    • 97. DELETE /posts/1.json Delete
    • 98. GET /posts.json Index</li></li></ul><li>Intermodal<br />CRUD specs<br />
    • 99. resources ’posts' dogiven_create_attributes:title => 'New Post', :account_id=> 1 given_update_attributes:name => 'Updated Post’expects_resource_crudend<br />
    • 100. Intermodal<br />CRUD specs<br />for <br />Nested Resource<br />
    • 101. resources [:posts, :comments] dogiven_create_attributes:title => 'New Comment', :account_id=> 1 given_update_attributes:name => 'Updated Comment’expects_resource_crudend<br />
    • 102. Intermodal<br />CRUD specs<br />for <br />Linked Resource<br />
    • 103. link_resource:post, :to => :authors, :with => Contributiondolet(:model_collection) do contributions post.authors.to_author_idsendlet(:unlinked_targets) { Author.make(3, :account => account) }expects_crud_for_linked_resourceend<br />
    • 104. Caveats<br />
    • 105. Extracted from Production<br />
    • 106. Yes, but …<br />
    • 107. Caveats<br />Installation sucks<br />No independent specs<br />Non-existent documentation<br />No Rails 3.1 support (yet)<br />No Ruby 1.9.2 support (yet)<br />
    • 108. Rails Stopped Innovating?<br />
    • 109. github.com/hosh/intermodal<br />Questions?<br />Ho-Sheng Hsiao<br />

    ×