O slideshow foi denunciado.
Utilizamos seu perfil e dados de atividades no LinkedIn para personalizar e exibir anúncios mais relevantes. Altere suas preferências de anúncios quando desejar.


575 visualizações

Publicada em

Publicada em: Tecnologia
  • Seja o primeiro a comentar

  • Seja a primeira pessoa a gostar disto


  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