Hacker News new | past | comments | ask | show | jobs | submit login

Rails didn't bastardize MVC, users of Rails bastardized MVC. Over the years we've seen the progressions of fat controllers to skinny controllers and fat models. Now, we're seeing the progression of using models only for responsibilities related to persisting the object. This leads to extracting additional domain logic into Presenters, Value, Service objects, etc.

Avdi Grimm has a great book about this called Objects on Rails[1] and Bryan Helmkamp from Code Climate has a good introductory blog post on it as well[2].

Rails implementation of MVC is perfectly fine. It's when people lean on MVC for everything without applying "classic" Object-Oriented design. That's when things become a mess.

1 - http://objectsonrails.com/

2 - http://blog.codeclimate.com/blog/2012/10/17/7-ways-to-decomp...




All programming language terminology gets blurrier the wider the usage of the term becomes. Right now, if you keep your eye out, you can see this is happening to the term "coroutine"; it's currently mutating from it's programming language research meaning [1] to something indistinguishable from "lightweight thread", or indeed possibly even indistinguishable from "thread".

"MVC" as a meaningful term has been dead for at least 5 years.

[1]: http://en.wikipedia.org/wiki/Coroutine


As an aside on terminology, why do we use the terms "skinny" and "fat"? Shouldn't it be "short" and "tall" since code is represented vertically?


Because that's the title of this blog post: http://weblog.jamisbuck.org/2006/10/18/skinny-controller-fat...

The only times 'fat' and 'skinny' are mentioned in the title.


I imagine the words as analogies to people and their ease of movement. Fat (“bloated”) components are hard to work with and develop, in the same way a fat person has trouble running from point to point. On the other hand, skinny components are easy to work with because there is little to comprehend, the same way that skinny (“lean”) people will run more quickly and easily.


because fatness is ammount of business logic, not ammount of lines of code. a model with 150 data fields can be a skinny model.


The decomposition of ActiveRecord Object is not bad. I don't like class like UserAuthentication and AbandonedTrialQuery. I would rather have something like.

#app/models/user/query.rb

class User

  module Scopes

    #my scopes.

  end
end


Everyone has their own preference for implementing object oriented design which will help push things forward. The important part is that people are thinking about object oriented design more than ever before.


Rails started out as a "the database is stupid, it is just storage" and "models are just object wrappers over your stupid database" as defining characteristics. And it has always had this weird notion that everything has to go through controllers. So it certainly did bastardize MVC, and the guy who came up with MVC has even pointed this out (not specifically about rails I don't think, but about the plethora of faux-MVC frameworks that exist now).




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: