NAME dao SYNOPSIS a library for structuring rails applications using the 'data access object' pattern DESCRITPION stay tuned... ISSUES ADRESSED . testability . documentability . being able to reason about code . reasoning about caching . avoiding duplicating logic in html/api . avoid N+1 in view . avoid design issues with REST (delete(1,2,3)) . nested attributes trivally . lack of domain (current_user) . easily optimize queries later . magic READING http://www.paperplanes.de/2010/5/7/activerecord_callbacks_ruined_my_life.html http://best-practice-software-engineering.ifs.tuwien.ac.at/patterns/dao.html http://www.codefutures.com/data-access-object/ http://java.sun.com/blueprints/corej2eepatterns/Patterns/DataAccessObject.html INSTALL gem 'dao', :path => File.expand_path('..') ### Gemfile rails generate dao api vim -o app/api.rb app/controllers/api_controller.rb curl --silent http://0.0.0.0:3000/api curl --silent http://0.0.0.0:3000/api/ping