What is the purpose of backbone.js?

前端 未结 15 1130
终归单人心
终归单人心 2020-12-02 03:22

I tried to understand the utility of backbone.js from its site http://documentcloud.github.com/backbone, but I still couldn\'t figure out much.

Can anybody help me b

相关标签:
15条回答
  • 2020-12-02 03:46

    Here's a quick Get Started post I wrote on BackboneJS. Hope it helps! http://www.infragistics.com/community/blogs/nanil/archive/2013/04/01/exploring-javascript-mv-frameworks-part-1-hello-backbonejs.aspx

    0 讨论(0)
  • 2020-12-02 03:47

    Is an MVC design pattern on the client side, believe me.. It's gonna save you tons of code, not to mention a more clean and clear code, a more easy to maintain code. Could be a little tricky at first, but believe me it's a great library.

    0 讨论(0)
  • 2020-12-02 03:48

    If you're going to build complex user interfaces in the browser then you will probably find yourself eventually inventing most of the pieces that make up frameworks like Backbone.js and Sammy.js. So the question is, are you building something complicated enough in the browser to merit using it (so you don't end up inventing the same thing yourself).

    If what you plan to build is something where the UI regularly changes how it displays but does not go to the server to get entire new pages then you probably need something like Backbone.js or Sammy.js. The cardinal example of something like that is Google's GMail. If you've ever used it you'll notice that it downloads one big chunk of HTML, CSS, and JavaScript when you first log in and then after that everything happens in the background. It can move between reading an email and processing the inbox and searching and back through all of them again without ever asking for a whole new page to be rendered.

    It's that kind of app that these frameworks excel at making easier to develop. Without them you'll either end up glomming together a diverse set of individual libraries to get parts of the functionality (for example, jQuery BBQ for history management, Events.js for events, etc.) or you'll end up building everything yourself and having to maintain and test everything yourself as well. Contrast that with something like Backbone.js that has thousands of people watching it on Github, hundreds of forks where people may be working on it, and hundreds of questions already asked and answered here on Stack Overflow.

    But none of it is of any importance if what you plan to build is not complicated enough to be worth the learning curve associated with a framework. If you're still building PHP, Java, or something else sites where the back end server is still doing all the heavy lifting of building the web pages upon request by the user and JavaScript/jQuery is just icing upon that process, you aren't going to need or are not yet ready for Backbone.js.

    0 讨论(0)
  • 2020-12-02 03:48

    Backbone.js is a JavaScript framework that helps you organize your code. It is literally a backbone upon which you build your application. It doesn't provide widgets (like jQuery UI or Dojo).

    It gives you a cool set of base classes that you can extend to create clean JavaScript code that interfaces with RESTful endpoints on your server.

    0 讨论(0)
  • 2020-12-02 03:48

    So many good answers already. Backbone js helps to keep the code organised. Changing the model/collection takes care of the view rendering automaticallty which reduces lot of development overhead.

    Even though it provides maximum flexibility for development, developers should be careful to destroy the models and remove the views properly. Otherwise there may be memory leak in the application.

    0 讨论(0)
  • 2020-12-02 03:49

    A web application involving lot of user interaction with many AJAX requests, which needs to be changed from time to time, and which runs in real time (such as Facebook or StackOverflow) ought to use an MVC framework such as Backbone.js. It's the best way to build good code.

    If the application is only small though, then Backbone.js is overkill, especially for first time users.

    Backbone gives you client side MVC, and all the advantages implied by this.

    0 讨论(0)
提交回复
热议问题