Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Is this Rails model?

Sponsored · Your Podcast. Everywhere. Effortlessly. Share. Educate. Inspire. Entertain. You do you. We'll handle the rest.

Is this Rails model?

Avatar for MOROHASHI Kyosuke

MOROHASHI Kyosuke

November 12, 2016
Tweet

More Decks by MOROHASHI Kyosuke

Other Decks in Programming

Transcript

  1. ‣ 10೥ઓ͖ͬͯͨRubyͱRails͸ɺWebαʔϏεͷ
 Ձ஋ΛϢʔβʔʹಧ͚ΔϨʔϧʹͳ͍ͬͯΔ ‣ ϒϥ΢β޲͚: HTML, JS & CSS ‣

    ΞϓϦ޲͚: JSON over HTTP ‣ ֤छσʔλετΞͷಡΈॻ͖ Why: ͜ͷ࿩͕Ͳ͏໾ʹཱͪͦ͏͔ 
  2. ‣ “Sustainable productivity for web-application development. ” ‣ 5෼ͰϒϩάΛ࡞Δ ‣

    Opinionated framework: ओு͕ڧ͍ ‣ MVC, DRY… Rails was coming : 2004-2007 
  3. ‣ At the heart of MVC (sniff) is what I

    call Separated Presentation. ‣ In MVC, the domain element is referred to as the model. Model objects are completely ignorant of the UI. ‣ http://martinfowler.com/eaaDev/uiArchs.html MVC 
  4. me @ 2004 - 2007  ‣ Railsษڧձ@౦ژ ‣ લ৬

    ESMʹస৬ ‣ ࢓ࣄͰRailsΛ࢖͍࢝ΊΔ ‣ RSpec΋
  5. ‣ 2013-06: Rails 4.0 ‣ Bundler, StrongParameters, Better ActiveModel ‣

    2016-08: Rails 5.0 ‣ ActiveJob, RailsAPI… 
  6. ‣ ෳ਺ςʔϒϧͷૢ࡞ͦΕࣗମΛΦϒδΣΫτͱͯ͠ நग़͢Δɻ ‣ ͋Δը໘͔ΒͷΈ࢖͏ϩδοΫΛɺڞ༗͞ΕΔAR Ϟσϧ͔Β෼཭ͤ͞Δɻ ‣ cf: DCIͷӨڹ ‣

    http://magazine.rubyist.net/?0041-RailsTheBadParts#l9 Interaction Object, Operation Object or Service Layer 
  7. ‣ ඇಉظ ‣ ෳ਺DB (ਨ௚෼ׂ, ਫฏ෼ׂ, RW-Spliting, NoSQL) ‣ APIܦ༝ͷଞγεςϜ࿈ܞ

    ‣ JavaScriptͷ·͢·͢ͷߴ౓Խ ‣ WebSocket … More & more new challengers! 
  8. ‣ Fat C ΑΓ͸Ϛγ͕ͩ Fat M ΋ͭΒ͍ɻ ‣ AR͚͕ͩϞσϧ͡Όͳ͍ɻ ‣

    VO΍ServiceLayer΋MVCͰ͍͏ϞσϧͷҰछ ‣ ઐ༻ͷσΟϨΫτϦ΄ͬͯ΋͍͍ ‣ Railsͷ্ͰͩͬͯOOPͰ͖Δ! ΦϨλνͷFatModelͱͷઓ͍͸͜Ε͔Βͩ