Are Rails and Django communities re-inventing the wheel?
intosimple.blogspot.in
intosimple.blogspot.in
"Not everyone is solving a scaling problem.
Django and Rails solve a problem that you can argue is much more common: writing concise yet readable code without needing reams of boilerplate to handle common cases."
Not everyone is on the same growth path.
It is really sad sometimes.
TL;DR: MVC Model is Logical model - business object (invoice) with business logic (delete_line_item), Rails Model is Physical model - persistence layer for RDBMS (add, update, delete, find rows).
In all but the most trivial applications, the latter assertion contradicts the former, and the former, is just outright wrong.
In MVC, Models are meant to model the logical objects of the system. An invoice is an object one which one acts. It is probably composed of several other objects (header, line items, addresses, etc.) which may in turn be composed of other objects.
Only the most trivial application have a one-to-one mapping from RDBMS rows to objects, which is what the OP asserts.
One does not write one's Models with the persistence layer in mind, one writes them with the business logic in mind.
So to me, this is where Rails gets the name Model wrong. The untrained, just starting out with rails learn that business logic goes in the model, so there is goes. But add_address() has no business living int he rails Model file for the invoice header, because that model is meant to be dedicated to manipulating invoice_header records in our RDBMS.
Yes, every new platform or framework reinvents the wheel, because they are almost all designed to do basically the same things, like CRUD.
I think the only way to avoid reinventing the wheel is to to adopt a common machine-processable abstraction that is at a higher level than the language and domain and use that to build the language and platform. Some type of knowledge representation maybe. Of course I'm not suggesting that is an easy thing to do.
http://en.wikipedia.org/wiki/Knowledge_representation_and_re...
I'm really tired of hearing this unqualified argument. Fat models is not a creed. It's a practical and natural design choice that we've made because it fits real world workflows best. Do you really want to be copy/pasting your order total calculation logic into 5 separate controller actions? Obviously not. And fat models doesn't mean 800 line source files. On reasonably sized Rails applications the logic gets bundled into nicely organized and maintainable concerns.
Every programming language sort of recreates the basics. They are the basics after all. The neat programming languages/frameworks are the ones that 'reinvent' something. Do something in a completely new way. On a programminglanguage-level it's difficult. A lot of the practices were already invented in early languages like lisp, eifel & smalltalk.
I like Ruby because it's not ashamed of taking the great parts from other programming languages and putting it together in an easily understandable language.
In what ways is Django sub-par compared to Rails?
It's about Ruby or common? Because I'm sure Models could have 0 code of working with database and business-logic only. It depends on architecture of project.
'Models could have 0 code of working with database and business-logic only' Well the business logic creeping in is one of the issues here. That is why there are attempts to separate out the business logic as in case of the use of /app/use_cases [refer to the link of use cases in the article].