Rails Architecture

I once knew someone who lived in a pretty cool apartment. The building had nice architecture on the outside as well as on the inside. There was a neat archway that joined the living and dining rooms. And the floorplan was somehow laid out to help a small space feel bigger than it was.
But, you’d hardly know it if you hadn’t been there at least 10 times. The person living there had stuff strewn all over. Things were cluttering up the space, making it far less usable and enjoyable.
Think of your Rails app like the interior of home. There are many rooms. Some of them have specific uses. The interior architecture influences how you live there.
Your objects live in your Rails app. Your models, views, and controllers need to communicate with each other and work together.
Rails dictates an MVC architecture. If you don’t follow that architecture, you’re going to make things harder on your objects to work together. If you put spatulas in the bathroom and the fridge in the bedroom, making dinner will be a lot harder than it ought to be.
So don’t be trying to have models generate HTML. Don’t have controllers go poking around the internals of all your models. Don’t have views trying to do a ton of queries.
If something feels hard to do in Rails, 95% of the time it’s because you’re cluttering up your app with objects in the wrong places, that you can’t leverage the wonderful architecture that surrounds them.




I like your metaphor.
Unfortunately, some people won’t understand it: they’ll point out that since they also put the TV in the bedroom, now the beer is closer at hand. And miss the general point ;-)
Indeed, nice metaphor!
“I never Metaphor I didn’t like”
I would like to like in the top of this appartments