- Backbone.js Patterns and Best Practices
- Swarnendu De
- 441字
- 2021-07-19 18:28:19
What this book covers
Chapter 1, Reducing Boilerplate with Plugin Development, starts with the basics of why reusing your code is important, and how we can achieve that by creating custom Backbone.js widgets and mixins.
Chapter 2, Working with Views, discusses the different points related to view rendering and layout management. Starting from partial updating of views, functionality of nested views or subviews for different processes of JavaScript template management and best practices, this chapter covers most of the problems a developer may face while working with views. We conclude by writing about the Marionette custom views and the Layout Manager plugin for complex app layout management.
Chapter 3, Working with Models, talks about different patterns while working with Backbone models, including data validation, model serialization to fetch data, and saving data to the server. We also analyze the relational data model for one-to-many and many-to-many relationships using Backbone's relational plugin.
Chapter 4, Working with Collections, covers a number of common problems that developers face while using Backbone collections. We explain how to apply basic and multiple sorting, how to apply filtering to a collection, and how to manage a collection while a mixed set of data is passed from the server.
Chapter 5, Routing Best Practices and Subrouting, covers a number of best practices you should follow while working with routers. We also discuss the benefits of using multiple routers or subrouters for complex and large-level applications.
Chapter 6, Working with Events, Sync, and Storage, begins by describing the importance of custom events to enhance an application's modularity and reusability. We also discuss using an application-level event manager to work as a centralized PubSub system, and the use of the Backbone.sync()
method to create different data-persistent strategies.
Chapter 7, Organizing Backbone Applications – Structure, Optimize, and Deploy, is one of the most important chapters that a developer will find very useful if they are developing a complex Backbone application. It talks about the application directory structure, organizing and managing files with RequireJS, and the different architectural patterns that every JavaScript developer should follow to develop large-scale application architectures.
Chapter 8, Unit Test, Stub, Spy, and Mock Your App, talks about the benefits of unit testing your JavaScript application, and introduces you to the QUnit and SinonJS test frameworks.
Appendix A, Books, Tutorials, and References, lists a number of useful Backbone.js resources that you may find helpful.
Appendix B, Precompiling Templates on the Server Side, describes the benefits of precompiling JavaScript templates at server side with examples.
Appendix C, Organizing Templates with AMD and Require.js, discusses the process of storing and organizing JavaScript templates with the RequireJS, text!, and tpl! plugins.
- C語言程序設計(第3版)
- 新一代通用視頻編碼H.266/VVC:原理、標準與實現
- C++ Builder 6.0下OpenGL編程技術
- PyTorch自然語言處理入門與實戰
- Java Web開發技術教程
- Big Data Analytics
- MongoDB權威指南(第3版)
- C/C++程序員面試指南
- SQL Server 入門很輕松(微課超值版)
- HTML5 WebSocket權威指南
- 威脅建模:設計和交付更安全的軟件
- 邊做邊學深度強化學習:PyTorch程序設計實踐
- Access 2013數據庫應用案例課堂
- Developing Multi:Platform Apps with Visual Studio Code
- Elasticsearch源碼解析與優化實戰