Re:Things I Wish I Had Known About Django Development Before...
by mercurial on Thursday April 18, 2013 @04:20AM
(#5569459)
That's very debatable, and pretty rails-specific, IMHO. Conventional wisdom in other ecosystems is instead to have a business logic layer between your controller and your persistence layer. I've always found this to be good advice, as it makes the code more testable and makes reasoning about manipulating different models in the same operation easier.
Re:Things I Wish I Had Known About Django Development Before...
by josephlord on Thursday April 18, 2013 @05:03AM
(#5569563)
The Rails models ARE the "business logic layer" between the controller and the persistence layer (the database itself).
I don't want to get into exactly what MVC should mean and whether any particular framework does it right though.
Yes, fat models are the way to go. This is just a good rule of thumb for any MVC framework. I feel like no framework docs actually explain this. Newbies end up shooting themselves in the foot because they don't understand the reason for separation or understand where logic should be implemented.