Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Javascript MVC frameworks [closed]

There are a lot of Javascript MVC frameworks available these days (Backbone.js, Cappuccino, Ember.js, GWT, etc), each having their own positives and negatives. My questions are ;

  1. What are the actual benefits that the MVC framework provides over normal Javascript ?
  2. Are all the frameworks mostly based on jQuery ?
  3. How does one decide which framework to go for? What are the questions that one needs to ask before pinpointing on some framework?
  4. One specific question that I have regarding MVC is there are some frameworks which update the view as soon as the model/data changes… So is that possible through AJAX?

Please let me know in very basic practical terms..

like image 247
copenndthagen Avatar asked Feb 27 '12 16:02

copenndthagen


People also ask

Is MVC framework still used?

Today the MVC pattern is used for modern web applications because it allows the application to be scalable, maintainable, and easy to expand.

Is there an MVC for JavaScript?

The MVC architecture is very useful in JavaScript as it offers more than allowing developers to create modular code. For instance, since the Model in MVC returns data without formatting, the same components can be called for use in different interfaces. This allows for code reusability.

What were the major problems with the MVC framework?

Major drawbacks of MVC in react js include manipulation of DOM which is very expensive and also at the cost of time and memory wastage. For implementing MVC, knowledge of multiple languages and technologies is required which requires enormous manpower having different expertise.


1 Answers

MVC gives architectural benefits over standard JavaScript - it helps you to write better organised, and therefore more maintainable code. It's a pattern that has been used and extensively tested over multiple languages and generations of programmers. Chances are, if you want to do something, someone else has already done it, so using a time-tested pattern helps you leverage the pattern's benefits, without making the mistakes that earlier programmers made, thus saving you time and effort

Backbone is not based on jQuery, but it is compatible with jQuery and gives you some goodies if you use it, e.g. in Views it gives you a cached reference to the views container in $el. But if you use Zepto instead of jQuery, $el is wrapped in Zepto functionality not jQuery.

YUI has MVC components and is completely not based on jQuery ;)

One decides which framework to use based on the needs of the current project, the documentation for the framework, the community it is based on, etc. The same as choosing which JS library to use, or which backend framework to use, etc. What's right for one person/project may not be right for another person/project

like image 177
danwellman Avatar answered Sep 21 '22 11:09

danwellman