Backbone.js patterns and best practices : a one-stop guide to best practices and design patterns when building applications using Backbone.js /
This is a step-by-step guide to design patterns, best practices, and solutions to common problems for Backbone.js-based application development. This book is for JavaScript developers who work with Backbone.js and want to learn the best design patterns to develop complex web applications. Basic know...
Clasificación: | Libro Electrónico |
---|---|
Autor principal: | |
Formato: | Electrónico eBook |
Idioma: | Inglés |
Publicado: |
Birmingham, UK :
Packt Publishing,
2014.
|
Colección: | Community experience distilled.
|
Temas: | |
Acceso en línea: | Texto completo |
Tabla de Contenidos:
- Cover; Copyright; Credits; About the Author; Acknowledgments; About the Reviewers; www.PacktPub.com; Table of Contents; Preface; Chapter 1:Reducing Boilerplate with Plugin Development; Basic components of Backbone.js; Using Underscore.js; Reusing code with extensions; Creating a base class; Developing plugins without extending base classes; Understanding JavaScript mixins; What is a mixin?; Creating classic mixins; Creating functional mixins; Caching mixin functions; Using curry to combine a function and arguments; Summary; Chapter 2:Working with Views; Basic usage of views
- Understanding the el propertyListening to view events; Displaying model data with templates; Partially updating a view; Understanding nested views; Knowing when to use subviews; Avoiding multiple DOM reflow; Re-rendering parent views; Removing parent views; Working with templates; Storing templates in an HTML file; Storing templates in a JavaScript file; Precompiling templates; Avoiding evaluation in templates; Using template helper functions; Understanding automatic model-view data binding; Using Marionette's ItemView, CollectionView, and CompositeView; ItemView; CollectionView
- Working with CompositeViewUsing Layout Manager; Summary; Chapter 3:Working with Models; Basic usage of models; Using defaults property; Avoiding object references in the defaults property; Data interaction with server; Validating the data; Using the Backbone. Validation plugin; Configuring validation rules; Prevalidating a model with the preValidate() method; Serializing models; Understanding the relational data model; Summary; Chapter 4:Working with Collections; Basic usage of collections; Performing data operations with collections; Fetching data from the server; Saving data to the server
- Sorting a collectionSorting a collection with multiple attributes; Filtering a collection; Performing basic filtering; Filtering a collection with a duplicate collection; Self-filtering with full data pointers; Understanding the collection of multiple model types; Summary; Chapter 5:Routing Best Practices and Subrouting; Working with routers; Best practices for working with routers; Avoiding large functional code in route methods; Instantiating views in router methods; Using regular expressions for selective routing; Subrouting
- a key to organizing complex apps; Summary
- Chapter 6:Working with Events, Sync, and StorageUnderstanding custom events; A simple case study on custom events; Using an event dispatcher; Creating multiple event dispatchers; Using different event namespaces; Avoiding memory leaks with the listenTo() method; Overriding the Backbone.sync() method; Offline storage using the Backbone. LocalStorage adapter; Summary; Chapter 7:Organizing Backbone Applications
- Structure, Optimize, and Deploy; Understanding the application directory structure; Working with Asynchronous Module Definition; Adding Require.js to your project