我试图从其网站http://documentcloud.github.com/backbone上了解backbone.js的实用功能,但我仍然搞不懂太多。

谁能帮我解释一下它是如何工作的,以及它如何有助于编写更好的JavaScript?


当前回答

I have to admit that all the "advantages" of MVC have never made my work easier, faster, or better. It just makes the whole codeing experience more abstract and time consuming. Maintenance is a nightmare when trying to debug someone elses conception of what separation means. Don't know how many of you people have ever tried to update a FLEX site that used Cairngorm as the MVC model but what should take 30 seconds to update can often take over 2 hours (hunting/tracing/debugging just to find a single event). MVC was and still is, for me, an "advantage" that you can stuff.

其他回答

I have to admit that all the "advantages" of MVC have never made my work easier, faster, or better. It just makes the whole codeing experience more abstract and time consuming. Maintenance is a nightmare when trying to debug someone elses conception of what separation means. Don't know how many of you people have ever tried to update a FLEX site that used Cairngorm as the MVC model but what should take 30 seconds to update can often take over 2 hours (hunting/tracing/debugging just to find a single event). MVC was and still is, for me, an "advantage" that you can stuff.

这是我在BackboneJS上写的一篇快速入门文章。希望能有所帮助! http://www.infragistics.com/community/blogs/nanil/archive/2013/04/01/exploring-javascript-mv-frameworks-part-1-hello-backbonejs.aspx

backbone.js是带有JavaScript的模型-视图-控制器(MVC) 但Extjs(归档)比骨干MVC模式的java脚本

有了骨气,你几乎可以自由地做任何你想做的事。而不是尝试通过api和自定义,我将使用Backbonejs,因为它的简单性和易于实现。同样,很难说你需要从这两者中得到什么,一个是库,另一个是组件

Backbone由Jeremy Ashkenas创建,他还编写了CoffeeScript。作为一个javascript较多的应用程序,我们现在所知道的Backbone负责将应用程序构建成一个一致的代码库。backbone的唯一依赖项Underscore.js也是DocumentCloud应用的一部分。

Backbone帮助开发人员在客户端web应用程序中管理数据模型,与传统服务器端应用程序逻辑中的规则和结构一样多。

使用Backbone.js的其他好处

将Backbone视为一个库,而不是一个框架 Javascript现在以一种结构化的方式组织起来,即(MVVM)模型 庞大的用户群体

这是一个很好的入门视频: http://vimeo.com/22685608

如果你想了解更多关于Rails和Backbone的知识,Thoughtbot有这本非常好的书(不是免费的): https://workshops.thoughtbot.com/backbone-js-on-rails