SlideShare a Scribd company logo
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?
It's OK to make a new folder within Rails.
It's OK to make a new folder within Rails.
What does this remind you of?
It's OK to make a new folder within Rails.
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/
It's OK to make a new folder within Rails.
It's OK to make a new folder within Rails.
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

More Related Content

PDF
Forget Ruby. Forget CoffeeScript. Do SOA
PDF
What rails taught me – Eugene Pirogov
PDF
If programming languages were hot babes
PDF
Metaprogramming in Ruby
PPTX
Functional programming in C#
PPTX
Comparing Golang and understanding Java Value Types
PDF
Merged Automation Talk - Pete Carapetyan - Feb 2016
KEY
How to give your project a kick in the mouth
Forget Ruby. Forget CoffeeScript. Do SOA
What rails taught me – Eugene Pirogov
If programming languages were hot babes
Metaprogramming in Ruby
Functional programming in C#
Comparing Golang and understanding Java Value Types
Merged Automation Talk - Pete Carapetyan - Feb 2016
How to give your project a kick in the mouth

Viewers also liked (20)

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

Similar to It's OK to make a new folder within Rails. (20)

PDF
Ruby On Rails
PDF
Beyond rails new
PDF
Pragmatic Patterns of Ruby on Rails - Ruby Kaigi2009
KEY
Supa fast Ruby + Rails
PPT
Ruby On Rails Siddhesh
PPT
Ruby On Rails
PPT
Ruby On Rails Tutorial
PPT
Rail3 intro 29th_sep_surendran
PDF
Aspose pdf
PPT
Ruby on rails
PDF
Ruby on-rails-101-presentation-slides-for-a-five-day-introductory-course-1194...
PDF
Rails is Easy*
PPT
Rails
 
PPTX
RubyConf Bangladesh 2017 - Rails buggy code
PDF
Ruby Rails Web Development
PPTX
12 Introduction to Rails
DOC
Rails interview questions
PDF
Sustainable Web Development With Ruby On Rails Practical Tips For Building We...
PDF
The Next Five Years of Rails
KEY
Rapid Prototyping FTW!!!
Ruby On Rails
Beyond rails new
Pragmatic Patterns of Ruby on Rails - Ruby Kaigi2009
Supa fast Ruby + Rails
Ruby On Rails Siddhesh
Ruby On Rails
Ruby On Rails Tutorial
Rail3 intro 29th_sep_surendran
Aspose pdf
Ruby on rails
Ruby on-rails-101-presentation-slides-for-a-five-day-introductory-course-1194...
Rails is Easy*
Rails
 
RubyConf Bangladesh 2017 - Rails buggy code
Ruby Rails Web Development
12 Introduction to Rails
Rails interview questions
Sustainable Web Development With Ruby On Rails Practical Tips For Building We...
The Next Five Years of Rails
Rapid Prototyping FTW!!!
Ad

Recently uploaded (20)

PDF
From MVP to Full-Scale Product A Startup’s Software Journey.pdf
PDF
Web App vs Mobile App What Should You Build First.pdf
PDF
MIND Revenue Release Quarter 2 2025 Press Release
PDF
A novel scalable deep ensemble learning framework for big data classification...
PDF
Microsoft Solutions Partner Drive Digital Transformation with D365.pdf
PPTX
1. Introduction to Computer Programming.pptx
PDF
gpt5_lecture_notes_comprehensive_20250812015547.pdf
PDF
Approach and Philosophy of On baking technology
PPTX
Chapter 5: Probability Theory and Statistics
PDF
1 - Historical Antecedents, Social Consideration.pdf
PDF
ENT215_Completing-a-large-scale-migration-and-modernization-with-AWS.pdf
PDF
project resource management chapter-09.pdf
PDF
Building Integrated photovoltaic BIPV_UPV.pdf
PPTX
TechTalks-8-2019-Service-Management-ITIL-Refresh-ITIL-4-Framework-Supports-Ou...
PDF
August Patch Tuesday
PDF
NewMind AI Weekly Chronicles - August'25-Week II
PPTX
cloud_computing_Infrastucture_as_cloud_p
PPTX
A Presentation on Artificial Intelligence
PDF
Video forgery: An extensive analysis of inter-and intra-frame manipulation al...
PDF
Encapsulation theory and applications.pdf
From MVP to Full-Scale Product A Startup’s Software Journey.pdf
Web App vs Mobile App What Should You Build First.pdf
MIND Revenue Release Quarter 2 2025 Press Release
A novel scalable deep ensemble learning framework for big data classification...
Microsoft Solutions Partner Drive Digital Transformation with D365.pdf
1. Introduction to Computer Programming.pptx
gpt5_lecture_notes_comprehensive_20250812015547.pdf
Approach and Philosophy of On baking technology
Chapter 5: Probability Theory and Statistics
1 - Historical Antecedents, Social Consideration.pdf
ENT215_Completing-a-large-scale-migration-and-modernization-with-AWS.pdf
project resource management chapter-09.pdf
Building Integrated photovoltaic BIPV_UPV.pdf
TechTalks-8-2019-Service-Management-ITIL-Refresh-ITIL-4-Framework-Supports-Ou...
August Patch Tuesday
NewMind AI Weekly Chronicles - August'25-Week II
cloud_computing_Infrastucture_as_cloud_p
A Presentation on Artificial Intelligence
Video forgery: An extensive analysis of inter-and intra-frame manipulation al...
Encapsulation theory and applications.pdf

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

Editor's Notes