为什么我们需要骨干JS或JS MVC框架? [英] why do we need backbone js or any JS MVC framework?

查看:146
本文介绍了为什么我们需要骨干JS或JS MVC框架?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

为什么我们需要的,如果我们已经使用后端MVC框架(如Django的或ROR)使用JS MVC框架(骨干)。我不明白两个MVC框架,以及如何将它们组合在一起的概念。我以为所有前端相关的文件或逻辑(HTML,CSS,JS)来后端框架的意见组件下。有人可以更简单地解释一下吗?

Why do we need to use a JS MVC framework(backbone) if we are already using a backend MVC framework(e.g Django or ROR). I can't understand the concept of two MVC frameworks and how they fit together. I thought all front-end related files or logic(html, css, js) come under the views component of the back-end framework. Can someone explain this in simpler terms?

推荐答案

骨干在于客户端[浏览],才能有快速的互动和经验。
这样,您就可以通过的WebSockets ,或LocalStorage 例如

Backbone lies in the client [browser], in order to have fast interaction and experience. This way you can take advantage of real-time communication via websockets, or LocalStorage for example.

使用客户端MVC [MVVM更好,在骨干网的情况下]意味着您只需从服务器[你可以在许多其他方面重用]提供一个RESTful集资源,而不是一个完整的HTML生成堆栈。

Using a client MVC [MVVM better, in Backbone's case] implies that you just supply a RESTful set of resource from the server [which you can reuse in many other context], and not a full HTML generation stack.

说,客户端MVC是不是面向Web MVC接近桌面/移动面向UI-MVC实现[见可可/ iOS版] [Symfony的,Django的,回报率...]

Said that, client side MVC is closer to desktop/mobile UI-oriented MVC implementations [see Cocoa / iOS] than to web-oriented MVC [Symfony, Django, RoR...].

这篇关于为什么我们需要骨干JS或JS MVC框架?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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