Ce diaporama a bien été signalé.
Nous utilisons votre profil LinkedIn et vos données d’activité pour vous proposer des publicités personnalisées et pertinentes. Vous pouvez changer vos préférences de publicités à tout moment.
Discovering a world of

Resources on Rails
David Heinemeier Hansson
Create Read Update Delete
What they told you...




Simplistic
Unfulfilling
Unworthy
Shameful
They were wrong
How I learned to stop
worrying and love the CRUD
find     create   update   destroy


SELECT   INSERT   UPDATE   DELETE
GET     POST      PUT     DELETE


 find     create   update   destroy


SELECT   INSERT   UPDATE   DELETE
POST   /people/create
GET    /people/show/1
POST   /people/update/1
POST   /people/destroy/1
POST     /people
GET      /people/1
PUT      /people/1
DELETE   /people/1
Why bother?




Consistency
Simplicity
Discoverability
Constraints are liberating
   (a straight jacket for your mind)
Model beyond “things”



Relations (membership, subscription)

Events (closure, change)

States (reviewed, accepted)
But!
CRUD is not a goal,
 it’s an aspiration,
a design technique
POST   /kases/1;close
       /identity;aspect

GET    /kases/1;edit
       /identity;view
And there is more!
Answering to mime types



One controller for many clients

One action returning different results

Flexible input model
One more thing
Active Resource
www.rubyonrails.org
Worldofresources
Worldofresources
Worldofresources
Worldofresources
Worldofresources
Worldofresources
Worldofresources
Worldofresources
Worldofresources
Worldofresources
Worldofresources
Worldofresources
Worldofresources
Worldofresources
Worldofresources
Worldofresources
Worldofresources
Worldofresources
Worldofresources
Worldofresources
Worldofresources
Worldofresources
Worldofresources
Worldofresources
Worldofresources
Worldofresources
Worldofresources
Worldofresources
Worldofresources
Worldofresources
Worldofresources
Worldofresources
Worldofresources
Worldofresources
Prochain SlideShare
Chargement dans…5
×

Worldofresources

559 vues

Publié le

Publié dans : Technologie
  • Soyez le premier à commenter

  • Soyez le premier à aimer ceci

Worldofresources

  1. 1. Discovering a world of Resources on Rails David Heinemeier Hansson
  2. 2. Create Read Update Delete
  3. 3. What they told you... Simplistic Unfulfilling Unworthy Shameful
  4. 4. They were wrong
  5. 5. How I learned to stop worrying and love the CRUD
  6. 6. find create update destroy SELECT INSERT UPDATE DELETE
  7. 7. GET POST PUT DELETE find create update destroy SELECT INSERT UPDATE DELETE
  8. 8. POST /people/create GET /people/show/1 POST /people/update/1 POST /people/destroy/1
  9. 9. POST /people GET /people/1 PUT /people/1 DELETE /people/1
  10. 10. Why bother? Consistency Simplicity Discoverability
  11. 11. Constraints are liberating (a straight jacket for your mind)
  12. 12. Model beyond “things” Relations (membership, subscription) Events (closure, change) States (reviewed, accepted)
  13. 13. But!
  14. 14. CRUD is not a goal, it’s an aspiration, a design technique
  15. 15. POST /kases/1;close /identity;aspect GET /kases/1;edit /identity;view
  16. 16. And there is more!
  17. 17. Answering to mime types One controller for many clients One action returning different results Flexible input model
  18. 18. One more thing
  19. 19. Active Resource
  20. 20. www.rubyonrails.org

×