Backbone.js的小白被相互矛盾的困惑教程 [英] backbone.js noob confused by conflicting tutorials

查看:165
本文介绍了Backbone.js的小白被相互矛盾的困惑教程的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我是新来Backbone.js的和我通过一些教程工作我的方式。我发现一对夫妇似乎不错,但也有在如何实现,所以我正在寻找最佳做法一些指导。一些不一致的地方

I'm new to backbone.js and am working my way through some tutorials. I've found a couple that seem good, but there are some inconsistencies in how they implement so I'm looking for a little guidance on best practices.

下面是我从学习教程:

我的问题是:


  1. 第一啧啧利用Backbone.Controller,但不Backbone.Collection。第二个则相反。这对于在骨干网自旋MVCC?
  2. 的最佳实践
  3. 第啧啧定义模型的URL,而第二个定义它的集合。哪个是更好的做法?

  4. 第二啧利用Backbone.Router的,而第一个没有。哪一个是最好的做法?

另外,如果有人可以建议如下我很乐意从那里学习最佳实践更好的介绍教程。不幸的是,因为这两者之间的不一致,我担心我可能会学习一些不良的生活习惯出了门。

Alternatively if someone can suggest a better intro tutorial that follows best practices I'd be happy to learn from there. Unfortunately because of the inconsistencies between these two, I'm concerned I might be learning some bad habits out of the gate.

先谢谢了。

推荐答案

Backbone.Controller是改名 Backbone.Router去年。我猜你读一个古老的教程。

Backbone.Controller was renamed to Backbone.Router last year. I guess you were reading an old tutorial.

BackboneTutorials.com 是入门像样的教程。

BackboneTutorials.com is a decent tutorial for getting started.

建立一个小的应用程序作为你学习,你就会知道做什么骨干适合你。

Build a small app as you learn and you'll know what Backbone does for you.

学习骨干的最好办法是要经过注明出处code 。每行被注释和解释。

The best way to learn Backbone is to go through the annotated source code. Each and every line is commented and explained.

构建应用程序时使用开发版本而不是缩小的版本。这有助于调试。

Use the dev version instead of the minified version when building your app. This helps in debugging.

如果你到读书,看看阿迪·奥斯马尼的骨干基础,一个免费的E-书。这本书是真棒,但相当冗长。你可以使用它作为一个参考。

If you are into reading books, check out Addy Osmani's Backbone Fundamentals, a free e-book. The book is awesome, but quite verbose. You can use it as a reference.

请参阅的 Quora的关于这个问题资源的最终名单;

See this question on Quora for the definitive list of resources;

不要太担心什么'V',什么是'C'和骨干对MVC旋转。
该框架确实分开code,随着服务器和code执行核心客户端逻辑交互的出色。模板和DOM元素被选择更新留给你。这是pretty在这个意义上简约。骨干提供活动,使不同地区的相互交流。

Don't worry too much about what's 'V' and what's 'C' and backbone's spin on MVC. The framework does an excellent job of separating code that interacts with the server and the code that performs the core client logic. Templating and updation of DOM Elements is left to you. It's pretty minimalistic in that sense. Backbone provides Events that make the different parts interact with each other.

这篇关于Backbone.js的小白被相互矛盾的困惑教程的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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