SlideShare uma empresa Scribd logo
1 de 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

Mais conteúdo relacionado

Destaque

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
 

Destaque (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
 

Semelhante a 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
 

Semelhante a 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
 

Último

DevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsDevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsSergiu Bodiu
 
WordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your BrandWordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your Brandgvaughan
 
Vertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering TipsVertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering TipsMiki Katsuragi
 
Unraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfUnraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfAlex Barbosa Coqueiro
 
Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!Manik S Magar
 
Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Enterprise Knowledge
 
Developer Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLDeveloper Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLScyllaDB
 
Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Commit University
 
Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Mattias Andersson
 
DevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenDevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenHervé Boutemy
 
What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024Stephanie Beckett
 
My INSURER PTE LTD - Insurtech Innovation Award 2024
My INSURER PTE LTD - Insurtech Innovation Award 2024My INSURER PTE LTD - Insurtech Innovation Award 2024
My INSURER PTE LTD - Insurtech Innovation Award 2024The Digital Insurer
 
Story boards and shot lists for my a level piece
Story boards and shot lists for my a level pieceStory boards and shot lists for my a level piece
Story boards and shot lists for my a level piececharlottematthew16
 
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage CostLeverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage CostZilliz
 
Human Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsHuman Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsMark Billinghurst
 
Gen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfGen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfAddepto
 
SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024Lorenzo Miniero
 
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Patryk Bandurski
 
Vector Databases 101 - An introduction to the world of Vector Databases
Vector Databases 101 - An introduction to the world of Vector DatabasesVector Databases 101 - An introduction to the world of Vector Databases
Vector Databases 101 - An introduction to the world of Vector DatabasesZilliz
 

Último (20)

DevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsDevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platforms
 
WordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your BrandWordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your Brand
 
Vertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering TipsVertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering Tips
 
Unraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfUnraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdf
 
Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!
 
Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024
 
Developer Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLDeveloper Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQL
 
Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!
 
Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?
 
DevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenDevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache Maven
 
What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024
 
My INSURER PTE LTD - Insurtech Innovation Award 2024
My INSURER PTE LTD - Insurtech Innovation Award 2024My INSURER PTE LTD - Insurtech Innovation Award 2024
My INSURER PTE LTD - Insurtech Innovation Award 2024
 
Story boards and shot lists for my a level piece
Story boards and shot lists for my a level pieceStory boards and shot lists for my a level piece
Story boards and shot lists for my a level piece
 
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage CostLeverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
 
Human Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsHuman Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR Systems
 
Gen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfGen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdf
 
SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024
 
DMCC Future of Trade Web3 - Special Edition
DMCC Future of Trade Web3 - Special EditionDMCC Future of Trade Web3 - Special Edition
DMCC Future of Trade Web3 - Special Edition
 
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
 
Vector Databases 101 - An introduction to the world of Vector Databases
Vector Databases 101 - An introduction to the world of Vector DatabasesVector Databases 101 - An introduction to the world of Vector Databases
Vector Databases 101 - An introduction to the world of Vector Databases
 

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

Notas do Editor

  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