的Javascript MVC框架的目的 [英] Purpose of Javascript MVC frameworks

查看:98
本文介绍了的Javascript MVC框架的目的的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想知道的Javascript MVC框架,如Backbone.js的和Spine.js的目的。作为一个狂热的/有经验的Ruby on Rails开发者,我从未有过的地方,我需要为我的应用程序的另一个MVC层的有用情况。它只是似乎很愚蠢的我。我大量使用非侵入式JavaScript处理事件和错误处理逻辑,但它并没有去尽可能创建类和看法对我的看法。

I am wondering the purpose of Javascript MVC frameworks such as Backbone.js and Spine.js. As an avid/experienced Ruby on Rails developer, I never had a useful case where I needed another MVC layer for my application. It just seems rather silly to me. I heavily use unobtrusive Javascript for handling events and error handling logic but it doesn't go as far as creating classes and views for my views.

请原谅我的无知,在这一领域,但我肯定希望得到经验丰富的开发人员这个回答。

Pardon my ignorance in this area but I would definitely like to get this answered from experienced developers.

推荐答案

JavaScript的MVC框架像Backbone.js的是添加结构前端。

JavaScript MVC frameworks like Backbone.js are for adding structure to your front-end.

建筑[日益流行]单页的JavaScript应用程序(SPJA)时,这是最有用的。如果你大量使用非侵入式JavaScript,你可能做的ajax相当数量的动态内容,以避免对用户刷新页面。 SPJA的借此通过让用户访问应用程序的所有领域而没有刷新页面了一步。未经MVC框架提供的结构,客户端code可以迅速得到了控制。

This is most useful when building [increasingly popular] single-page JavaScript apps (SPJA). If you're heavily using unobtrusive JavaScript, you're probably doing a fair amount of ajax for dynamic content to avoid refreshing the page on the user. SPJA's take this a step further by letting the user visit all areas of an app without ever refreshing the page. Without the structure provided by MVC frameworks, the client-side code can quickly get out of control.

这篇关于的Javascript MVC框架的目的的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆