← Back to Upcase

Javascript framework

(charlieanna) #1

Which javascript framework is more closer to the MVC pattern like in Ruby On Rails?

I use Angular.js in my project but I don’t get true MVC in it. I think Backbone is more apt for MVC where the 3 components are kept independent very nicely. Whereas In angular.js I think there isnt a clear separation mixing models inside the views and then inside the controllers and using a two way binding. Should I be switching to backbone.js? I often feel Angular.js is very strange.

(Matthew Sumner) #2

This is a really tough question. I’ve been learning ember.js and this is supposed to have a true MVC structure. The problem is that rails doesn’t follow what is traditionally called MVC. This is because rails is a server side framework while your javascript is client side. I’ve done a post about this on my blog concerning the differences between rails and ember but it’s something that doesn’t have a trivial answer. As far as I know there isn’t any client side framework that is very similar to rails and there are a lot of arguments that there shouldn’t be.

(charlieanna) #3

I think the developers need to understand what true MVC is and try to keep a clear separation between them. Even by using Backbone or Ember you could end up mixing everything. I guess it is all about experience so that tomorrow when we are looking at the code we dont end up getting lost in the maze.

(Chris Toomey) #4

Yehuda of Rails and Ember fame recently gave a talk about the distinctions between the various “MVC” patterns used by both Rails and some of the various javascript frameworks. You can find the talk here: http://confreaks.com/videos/2674-gogaruco2013-a-tale-of-two-mvc-s.