SlideShare ist ein Scribd-Unternehmen logo
1 von 38
It's OK to make a new folder within Rails.

          Collin Schaafsma, Founder @ Quick Left
                     @collinschaafsma
My Rails app just got complex bro


            so now what?
(Clojure)
Node.js
JKLOL


this is a ruby / rails talk
WTF is Rails
WTF is Rails
it’s why we can’t have nice things
WTF is a Framework
I promise this is the last time we define something in this talk
Just to be clear
    I like Rails
But... Rails is not your app
Has Rails owned your app?
What does this remind you of?
So. What is a model?
I lied, we are about to define something again
Classes that store, and optionally
         separate, data
         Persistence mother-fu@*er!
How do we break this apart?
This is not a new problem
   Most likely it’s been solved before
Facades        Bridges
Factories                Presenters
            Decorators
                          Proxies
  Mediators
             Builders
    Reactors       Observers
But wait, we have three choices
model / view / controller
we can randomly toss shit in helpers/ and lib/
Don’t let Rails kill your software
          design skills
         you’re smarter than that
Example Apps
 Oh snap. Real code.
Why?
                       Dude. I gotta get shit done.



If you don’t have time to do it right, when will you have time to do it
over?                                                    John Wooden

The only way to make the deadline -- the only way to go fast -- is to
keep the code as clean as possible at all times.      Robert C. Martin
S.O.L.I.D
Folks can grock it
Easier Refactoring
  Testable Code
Speaking of testing
Speaking of testing
Testing should be fast. Really fast.
Step (1) Cut a hole in a box
Step (2) Don’t put Rails in that box
Example Code
Damn son. More code.
TDD promotes good design
    TDD might not actually suck!
The word on the street
We need something better. Persistence and logic are two separate
responsibilities that every rails app combines.      Steve Klabnik

I pull the behavior out of my models into other objects that wrap the
models. I prefer to make the AR objects simple wrappers around the db-
access stuff in AR.
                                                        Corey Haines
Let’s recap
Thanks!
Resources
            Example Rails app
https://github.com/collinschaafsma/loyd

            Example Sinatra app
https://github.com/collinschaafsma/slimfit

              More resources
     https://gist.github.com/1934139
             @collinschaafsma

Weitere ähnliche Inhalte

Andere mochten auch

Lcif policies – current & future
Lcif policies – current & futureLcif policies – current & future
Lcif policies – current & futurelionsleaders
 
16 my ideal club promo 1101
16 my ideal club promo 110116 my ideal club promo 1101
16 my ideal club promo 1101lionsleaders
 
Sight first and md322 linda romano derr
Sight first and md322   linda romano derrSight first and md322   linda romano derr
Sight first and md322 linda romano derrlionsleaders
 
Job responsibility of zone chairperson lionistic year 2013 14
Job responsibility of zone chairperson lionistic year 2013 14Job responsibility of zone chairperson lionistic year 2013 14
Job responsibility of zone chairperson lionistic year 2013 14lionsleaders
 
Your success formula
Your success formulaYour success formula
Your success formulalionsleaders
 
Follow your Dream - Part 2
Follow your Dream - Part 2Follow your Dream - Part 2
Follow your Dream - Part 2lionsleaders
 
What makes a good convention klaus tang
What makes a good convention  klaus tangWhat makes a good convention  klaus tang
What makes a good convention klaus tanglionsleaders
 
Cooper.ann arbor
Cooper.ann arborCooper.ann arbor
Cooper.ann arborTrailnet
 
Having fun at club meetings
Having fun at club meetingsHaving fun at club meetings
Having fun at club meetingslionsleaders
 
Energize Club Excellence Process
Energize Club Excellence ProcessEnergize Club Excellence Process
Energize Club Excellence Processlionsleaders
 
The International Association of Lions Clubs MD322 LCIF CONCLAVE – 2014 YOGA ...
The International Association of Lions Clubs MD322 LCIF CONCLAVE – 2014 YOGA ...The International Association of Lions Clubs MD322 LCIF CONCLAVE – 2014 YOGA ...
The International Association of Lions Clubs MD322 LCIF CONCLAVE – 2014 YOGA ...lionsleaders
 
Lcif and sf dr pararajasegram
Lcif and sf   dr pararajasegramLcif and sf   dr pararajasegram
Lcif and sf dr pararajasegramlionsleaders
 
Presentation in the British Embassy in Madrid - Threats and opportunities in ...
Presentation in the British Embassy in Madrid - Threats and opportunities in ...Presentation in the British Embassy in Madrid - Threats and opportunities in ...
Presentation in the British Embassy in Madrid - Threats and opportunities in ...col.lab | collaboration laboratory
 
Surviving economic downturn
Surviving economic downturnSurviving economic downturn
Surviving economic downturnlionsleaders
 
Operation eyesight
Operation eyesightOperation eyesight
Operation eyesightlionsleaders
 
Lions first aid centre bihar- dist 322 e
Lions first aid centre bihar- dist 322 eLions first aid centre bihar- dist 322 e
Lions first aid centre bihar- dist 322 elionsleaders
 

Andere mochten auch (20)

Lcif policies – current & future
Lcif policies – current & futureLcif policies – current & future
Lcif policies – current & future
 
16 my ideal club promo 1101
16 my ideal club promo 110116 my ideal club promo 1101
16 my ideal club promo 1101
 
Sight first and md322 linda romano derr
Sight first and md322   linda romano derrSight first and md322   linda romano derr
Sight first and md322 linda romano derr
 
Change - ap singh
Change -  ap singhChange -  ap singh
Change - ap singh
 
Team building
Team buildingTeam building
Team building
 
Job responsibility of zone chairperson lionistic year 2013 14
Job responsibility of zone chairperson lionistic year 2013 14Job responsibility of zone chairperson lionistic year 2013 14
Job responsibility of zone chairperson lionistic year 2013 14
 
Your success formula
Your success formulaYour success formula
Your success formula
 
Follow your Dream - Part 2
Follow your Dream - Part 2Follow your Dream - Part 2
Follow your Dream - Part 2
 
What makes a good convention klaus tang
What makes a good convention  klaus tangWhat makes a good convention  klaus tang
What makes a good convention klaus tang
 
Cooper.ann arbor
Cooper.ann arborCooper.ann arbor
Cooper.ann arbor
 
Having fun at club meetings
Having fun at club meetingsHaving fun at club meetings
Having fun at club meetings
 
Teamwork
TeamworkTeamwork
Teamwork
 
Energize Club Excellence Process
Energize Club Excellence ProcessEnergize Club Excellence Process
Energize Club Excellence Process
 
The International Association of Lions Clubs MD322 LCIF CONCLAVE – 2014 YOGA ...
The International Association of Lions Clubs MD322 LCIF CONCLAVE – 2014 YOGA ...The International Association of Lions Clubs MD322 LCIF CONCLAVE – 2014 YOGA ...
The International Association of Lions Clubs MD322 LCIF CONCLAVE – 2014 YOGA ...
 
Lcif and sf dr pararajasegram
Lcif and sf   dr pararajasegramLcif and sf   dr pararajasegram
Lcif and sf dr pararajasegram
 
Presentation in the British Embassy in Madrid - Threats and opportunities in ...
Presentation in the British Embassy in Madrid - Threats and opportunities in ...Presentation in the British Embassy in Madrid - Threats and opportunities in ...
Presentation in the British Embassy in Madrid - Threats and opportunities in ...
 
Surviving economic downturn
Surviving economic downturnSurviving economic downturn
Surviving economic downturn
 
SMART Technologies and Escuela 2.0
SMART Technologies and Escuela 2.0SMART Technologies and Escuela 2.0
SMART Technologies and Escuela 2.0
 
Operation eyesight
Operation eyesightOperation eyesight
Operation eyesight
 
Lions first aid centre bihar- dist 322 e
Lions first aid centre bihar- dist 322 eLions first aid centre bihar- dist 322 e
Lions first aid centre bihar- dist 322 e
 

Ähnlich wie It's OK to make a new folder within Rails.

Analyze and Visualize Git Log for Fun and Profit - DevTernity 2015
Analyze and Visualize Git Log for Fun and Profit - DevTernity 2015Analyze and Visualize Git Log for Fun and Profit - DevTernity 2015
Analyze and Visualize Git Log for Fun and Profit - DevTernity 2015Raimonds Simanovskis
 
OO and Rails...
OO and Rails... OO and Rails...
OO and Rails... adzdavies
 
Ruby On Rails Presentation
Ruby On Rails PresentationRuby On Rails Presentation
Ruby On Rails PresentationPaul Pajo
 
Top 10+ Things .NET Developers Should Know About Ruby
Top 10+ Things .NET Developers Should Know About RubyTop 10+ Things .NET Developers Should Know About Ruby
Top 10+ Things .NET Developers Should Know About RubyJeff Cohen
 
Ruby Metaprogramming - OSCON 2008
Ruby Metaprogramming - OSCON 2008Ruby Metaprogramming - OSCON 2008
Ruby Metaprogramming - OSCON 2008Brian Sam-Bodden
 
Contribute to rails
Contribute to railsContribute to rails
Contribute to railsmartinsvalin
 
What Web Framework To Use?
What Web Framework To Use?What Web Framework To Use?
What Web Framework To Use?Kasra Khosravi
 
DiUS Computing Lca Rails Final
DiUS  Computing Lca Rails FinalDiUS  Computing Lca Rails Final
DiUS Computing Lca Rails FinalRobert Postill
 
Ruby on Rails - An overview
Ruby on Rails -  An overviewRuby on Rails -  An overview
Ruby on Rails - An overviewThomas Asikis
 
Ruby On Rails Overview
Ruby On Rails OverviewRuby On Rails Overview
Ruby On Rails Overviewjonkinney
 
Ruby On Rails For .Net Developers
Ruby On Rails For .Net DevelopersRuby On Rails For .Net Developers
Ruby On Rails For .Net DevelopersBrad Tutterow
 
Finding Frank - Spotify API.pdf
Finding Frank - Spotify API.pdfFinding Frank - Spotify API.pdf
Finding Frank - Spotify API.pdfaspleenic
 
Documentation for developers
Documentation for developersDocumentation for developers
Documentation for developersMichael Marotta
 
Viridians on Rails
Viridians on RailsViridians on Rails
Viridians on RailsViridians
 
C# .NET - Um overview da linguagem
C# .NET - Um overview da linguagem C# .NET - Um overview da linguagem
C# .NET - Um overview da linguagem Claudson Oliveira
 
Raphael Amorim - Scrating React Fiber
Raphael Amorim - Scrating React FiberRaphael Amorim - Scrating React Fiber
Raphael Amorim - Scrating React FiberReact Conf Brasil
 

Ähnlich wie It's OK to make a new folder within Rails. (20)

Analyze and Visualize Git Log for Fun and Profit - DevTernity 2015
Analyze and Visualize Git Log for Fun and Profit - DevTernity 2015Analyze and Visualize Git Log for Fun and Profit - DevTernity 2015
Analyze and Visualize Git Log for Fun and Profit - DevTernity 2015
 
OO and Rails...
OO and Rails... OO and Rails...
OO and Rails...
 
Ruby On Rails Presentation
Ruby On Rails PresentationRuby On Rails Presentation
Ruby On Rails Presentation
 
Ruby Metaprogramming 08
Ruby Metaprogramming 08Ruby Metaprogramming 08
Ruby Metaprogramming 08
 
Top 10+ Things .NET Developers Should Know About Ruby
Top 10+ Things .NET Developers Should Know About RubyTop 10+ Things .NET Developers Should Know About Ruby
Top 10+ Things .NET Developers Should Know About Ruby
 
Ruby Metaprogramming - OSCON 2008
Ruby Metaprogramming - OSCON 2008Ruby Metaprogramming - OSCON 2008
Ruby Metaprogramming - OSCON 2008
 
Contribute to rails
Contribute to railsContribute to rails
Contribute to rails
 
What Web Framework To Use?
What Web Framework To Use?What Web Framework To Use?
What Web Framework To Use?
 
DiUS Computing Lca Rails Final
DiUS  Computing Lca Rails FinalDiUS  Computing Lca Rails Final
DiUS Computing Lca Rails Final
 
Ruby on Rails - An overview
Ruby on Rails -  An overviewRuby on Rails -  An overview
Ruby on Rails - An overview
 
ruby pentest
ruby pentestruby pentest
ruby pentest
 
Rails New Way
Rails New WayRails New Way
Rails New Way
 
Ruby On Rails Overview
Ruby On Rails OverviewRuby On Rails Overview
Ruby On Rails Overview
 
Ruby On Rails For .Net Developers
Ruby On Rails For .Net DevelopersRuby On Rails For .Net Developers
Ruby On Rails For .Net Developers
 
Finding Frank - Spotify API.pdf
Finding Frank - Spotify API.pdfFinding Frank - Spotify API.pdf
Finding Frank - Spotify API.pdf
 
Ruby on rails
Ruby on railsRuby on rails
Ruby on rails
 
Documentation for developers
Documentation for developersDocumentation for developers
Documentation for developers
 
Viridians on Rails
Viridians on RailsViridians on Rails
Viridians on Rails
 
C# .NET - Um overview da linguagem
C# .NET - Um overview da linguagem C# .NET - Um overview da linguagem
C# .NET - Um overview da linguagem
 
Raphael Amorim - Scrating React Fiber
Raphael Amorim - Scrating React FiberRaphael Amorim - Scrating React Fiber
Raphael Amorim - Scrating React Fiber
 

Kürzlich hochgeladen

WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure serviceWhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure servicePooja Nehwal
 
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slidevu2urc
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Miguel Araújo
 
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Igalia
 
Unblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesUnblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesSinan KOZAK
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘RTylerCroy
 
Understanding the Laravel MVC Architecture
Understanding the Laravel MVC ArchitectureUnderstanding the Laravel MVC Architecture
Understanding the Laravel MVC ArchitecturePixlogix Infotech
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonetsnaman860154
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationRadu Cotescu
 
Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101Paola De la Torre
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationMichael W. Hawkins
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsEnterprise Knowledge
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerThousandEyes
 
Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slidespraypatel2
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsMaria Levchenko
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonAnna Loughnan Colquhoun
 
Enhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for PartnersEnhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for PartnersThousandEyes
 
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfThe Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfEnterprise Knowledge
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Drew Madelung
 

Kürzlich hochgeladen (20)

WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure serviceWhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
 
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slide
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
 
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
 
Unblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesUnblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen Frames
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘
 
Understanding the Laravel MVC Architecture
Understanding the Laravel MVC ArchitectureUnderstanding the Laravel MVC Architecture
Understanding the Laravel MVC Architecture
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonets
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organization
 
Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day Presentation
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI Solutions
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slides
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed texts
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt Robison
 
Enhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for PartnersEnhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for Partners
 
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfThe Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
 

It's OK to make a new folder within Rails.

Hinweis der Redaktion

  1. \n
  2. \n
  3. \n
  4. \n
  5. \n
  6. \n
  7. \n
  8. \n
  9. \n
  10. \n
  11. \n
  12. \n
  13. \n
  14. \n
  15. \n
  16. \n
  17. \n
  18. \n
  19. \n
  20. \n
  21. \n
  22. \n
  23. \n
  24. \n
  25. \n
  26. \n
  27. \n
  28. \n
  29. \n
  30. \n
  31. \n
  32. \n
  33. \n
  34. \n
  35. \n
  36. \n
  37. \n