Friday, 8 June 2018

003 BackboneJS Architecture

BackboneJS is a JavaScript library to manage large code in a smart way. BackboneJS separate business logic and user interface logic and makes the code clean , structured and maintainable.BackboneJS is a kind of design practices that you would to help design better , basically helps organize your code and separate their concerns.
The Below  image show the architecture of .BackboneJS have several modules
  • HTTP request 
  • Router 
  • View 
  • Events  
  • Models 
  • Collections 
  • Data source
HTTP Request : In a BackboneJS application , client request to server via http request. The request can be for file ,document ,image through HTTP protocol. The request message can be come from browser or search engine ect.


Router :It is used for routing the client side applications and connects them to actions and events using URL's.Based on the url fragments you can choose to 'route' your applications logic,you can choose what functions to invoke so you effectively 'route' to the right set of methods based on your logic.


View : BackboneJS create model according to business logic. No HTML markup associated with JavaScript code. When model changes, corresponding view automatically changes without reloading the pages. BackboneJS follow MVC architecture, view and module communicate via event. When a model is changed and event is trigged corresponding view also changes.







Events : Events is the most important part of the BackboneJS application. View and modules communicate via events. BackboneJS bind custom element to an application event can be mixed to any object capable of  binding and triggering object.

Models : Models contain data of an application. Model contain business entity with validation a business logic. Model is responsible to supply data to view  and get data from view for storage. Model is core object of in JavaScript application.

Collections : A collection is a number of  model used  bind event. You can loop through collections and made change respective models. Collection support sorting and filtering. A model structure and instance should be created before creating a collection.Beside from their own events, collections also proxy through all of the events that occur to models within them.

Data source : Data sourc do connection set up to a database from a server and contains the information that is requested from the client. Below is the steps of flow 

       1)User requests for the data using the router, that routes applications to the events using the URL's.

      2)View represents the model's data to the user.

       3)Model and collection retrieves and populates the data from the database by binding custom events.



No comments:

Post a Comment

বাঙালির বেড়ানো সেরা চারটি ঠিকানা

  বাঙালি মানে ঘোড়া পাগল | দু একদিন ছুটি পেলো মানে বাঙালি চলল ঘুরতে | সে সমুদ্রই হোক , পাহাড়ি হোক বা নদী হোক। বাঙালির ...