BackboneJS - SPLessons

Backbone.js Architecture

Home > Lesson > Chapter 2
SPLessons 5 Steps, 3 Clicks
5 Steps - 3 Clicks

Backbone.js Architecture

Backbone.js Architecture

shape Introduction

This chapter demonstrates about the Backbone.js Architecture which is used to specify the structure of the web application and following are the concepts covered in this chapter.
  • Architecture of Backbone.js

Architecture of Backbone.js

shape Description

Architecture is used to specify the structure of the web application which allows us to differentiate the User interface logic and business logic The image below demonstrates the Architecture of the Backbone.js. Following are some modules are listed below. HTTP Request The HTTP requests are sent by the client to a server in the form of general request messages wherever web browsers, search engines etc. are acts like HTTP clients. The user will request for a file like images, documents, etc using HTTP request protocol. The user will able to see within the above diagram that an HTTP client uses the router to send some client request.Router. View The Backbone.js view specifies however and what to display from the application. Which does not contain HTML markup for the application? It presents the model's data to the client. it's used to display "the appearance of your data model". A view does not grasp something about the HTML and CSS and every view of document can be updated independently without reloading the total page if a change occurs within the model. The user can see within the higher than architecture, views represent the user interface which displays the response for requests done by the router. Events The event is the main a part of an application. Which binds clients custom events to the application. Events may be get added into any object and are capable of binding and triggering custom events. The user will able to bind the custom events by using name according to the selection. A user will able to see the above architecture that once an event happens, it displays the data of the model by using the read. Model Model is thought as a core of the JavaScript application. Which retrieves and circulates the data. Models accommodate the logic and data of the application and represent basic data object within the framework. Models also represent business entities with some logics and validations. Its main usage is storage of data and business logic. Which is retrieved from and saved on the data storage? Collection The collection may be a set of models used to bind events, once a modification is made to the collection. In a collection, there's a listing of models which will be processed within the loop and support filtering and sorting. The user can define the kind of model which a collection goes to have along with the instance of properties while making a collection. Data Source The data source may be a connection server to database. It contains the data requested by the consumer. the subsequent steps describe the structure of data source in Backbone.js architecture. By using router user can request the data. Which is used to route the applications to the events using URLs. The view represents model's data to the user. The model and collection retrieve and circulates the data from the database through binding the custom events.

Summary

shape Key Points

  • Architecture specify the structure of the web application.
  • HTTP request is sent a client to the server.
  • Data source contains the data which is requested from the consumer.