I do have a book coming out called Caboose on the Loose (https://leanpub.com/cabooseontheloose) that goes over how I build applications. It'll be for monies, but I plan on uploading it to torrent and piracy sites; included is a page that reads I'm cool if you pirate it. Happy to send an early draft; email is in profile.
A lot of it has been trying and failing — a lot of times, across a lot of different applications. Many of which have been my own, but as of the last few years there have been other people's applications too.
The first thing I look for when I go into someone else's Rails app is to grep through `routes.rb` and look for every route drawn that's not `resource` or `resources`. This has proven to be a good indicator of the amount of smells I'll encounter in the application. You can draw every route with `resources` or `resource` and get clean controllers, which leads me to my next point:
Your controllers are the most important part of your application. It's the first and last thing your user touches. Getting them right is the most difficult part of architecting any application. "Fat models skinny controllers" does a disservice to models, though, because they shouldn't be fat, (insert transition)...
Models should represent your database and nothing more.
I could go on and on, and am happy to, but I'll quickly be writing a mini-book here and detract from Eileen's great talk at Railsconf. :)
Some nuggets here: https://news.ycombinator.com/item?id=35755423
A lot of it has been trying and failing — a lot of times, across a lot of different applications. Many of which have been my own, but as of the last few years there have been other people's applications too.
The first thing I look for when I go into someone else's Rails app is to grep through `routes.rb` and look for every route drawn that's not `resource` or `resources`. This has proven to be a good indicator of the amount of smells I'll encounter in the application. You can draw every route with `resources` or `resource` and get clean controllers, which leads me to my next point:
Your controllers are the most important part of your application. It's the first and last thing your user touches. Getting them right is the most difficult part of architecting any application. "Fat models skinny controllers" does a disservice to models, though, because they shouldn't be fat, (insert transition)...
Models should represent your database and nothing more.
I could go on and on, and am happy to, but I'll quickly be writing a mini-book here and detract from Eileen's great talk at Railsconf. :)