Book Image

Mastering ArcGIS Server Development with JavaScript

By : Raymond Kenneth Doman
Book Image

Mastering ArcGIS Server Development with JavaScript

By: Raymond Kenneth Doman

Overview of this book

Table of Contents (18 chapters)
Mastering ArcGIS Server Development with JavaScript
Credits
About the Author
About the Reviewers
www.PacktPub.com
Preface
Index

An overview of Backbone.js


With a simple application like the one we wrote with jQuery, the logic can turn into spaghetti-code rather quickly. We need to implement good practices to organize our code. Which practices do we implement? One of the first libraries to try to answer this question is Backbone.js.

Backbone.js is one of the earliest JavaScript libraries to implement a Model View Controller (MVC) architecture. MVC organizes code by separating data and business logic (the Model) from the output (the View) and updates both through a separate component (the Controller). With MVC, you don't write a complicated JavaScript function that gets input from some text blanks, adds the contents together, and saves the results. Those three actions can be written into three different functions, separated by what they do and how they fit into the Model, View, and Controller classifications.

Backbone.js requires a couple of other libraries in order to work properly. Backbone uses jQuery to handle DOM...