- Mastering Backbone.js
- Abiee Echamea
- 292字
- 2021-07-23 14:39:32
Chapter 1. Architecture of a Backbone application
One of the best things about Backbone is the freedom to build applications with the libraries of your choice, no batteries included. Note that Backbone is not a framework but a library; due to this, building applications with Backbone can be challenging as no structure is provided. You, as a developer, are responsible for code organization and how to wire the pieces of the code across the application; it's a big responsibility. Bad decisions can lead to buggy and unmaintainable applications that nobody wants to work with.
Code organization on small Backbone applications is not a big deal. Create a directory for models, collections, and views; put a router for all possible routes; and write the business logic directly in the views. However, this way of developing Backbone applications is not suitable for bigger projects. There should be a better way to separate responsibilities and file organization in order to create maintainable applications.
This chapter can be difficult to understand if you don't know Backbone at all; to understand the principles that are exposed here better, you will need to understand at least the basics of Backbone. Therefore, if you are a beginner in Backbone, I would encourage you to first understand what Backbone is and how it works.
The goal of this chapter is to explore the best practices of project organization on two main levels: logic organization and file structure. In this chapter, you will learn the following:
- Delegating the right responsibilities to the objects provided by Backbone
- Defining plain JavaScript objects in order to deal with logic out of scope of Backbone objects
- Splitting the application in to small and maintainable scripts
- Creating a clean file structure for your projects
- UML和模式應用(原書第3版)
- Hands-On Machine Learning with scikit:learn and Scientific Python Toolkits
- Android Studio Essentials
- C語言程序設計實訓教程
- 編寫高質量代碼:改善Python程序的91個建議
- Java程序員面試算法寶典
- Java EE核心技術與應用
- Microsoft Azure Storage Essentials
- iPhone應用開發從入門到精通
- Beginning C++ Game Programming
- 微信小程序開發實戰:設計·運營·變現(圖解案例版)
- Getting Started with Python
- Practical Microservices
- Learning Android Application Testing
- Design Patterns and Best Practices in Java