Balavignesh Kasinathan
Introduction
What?
Backbone.js
Why?
Web Applications Demand
Whom?
Beginners to Intermediate
*Beginners => Basic JS + Jquery
Plan
Day 1:
1.5 hrs JS concepts + Jquery + Underscore library
1.5 hrs Basic Elements of Backbone
Day 2:
1 hr Example with Backbone - Local Storage
1 hr Example with Backbone - Persistance
1 hr Boilerplate, RequireJS
Goal
Understading the necessity of MV* Framework
Understanding the basic elements of
Backbone
Overview on designing web app with backbone
Sharing experience / knowledge
Resources / Books
● http://backbonejs.org/
● http://addyosmani.github.io/backbone-fundame
ntals/
● Javascript The Good Parts – Douglas
Crockford
● https://developer.mozilla.org/en/Learn/JavaScr
ipt
Practice
http://jsfiddle.net/
● jquery 2.1.0
● https://cdnjs.cloudflare.com/ajax/libs/json2/20140204/json2.min.js
● https://cdnjs.cloudflare.com/ajax/libs/underscore.js/1.8.2/underscore-
min.js
● https://cdnjs.cloudflare.com/ajax/libs/backbone.js/1.1.2/backbone-min.js
Backbone.js
● Author - Jeremy Ashkenas
● Stable Release - 1.1.2
● License - MIT
● http://backbonejs.org/
● Dependency
Underscore.js -> http://underscorejs.org/
JS Frameworks
https://www.airpair.com/js/javascript-framework
-comparison
Testimonials
● Digg
● LinkedIn Mobile
● Bit Torrent
● Wordpress
● Documentcloud
MVC -Design Pattern
Image Source - http://addyosmani.github.io/backbone-fundamentals/
JS OOP Basics- DataTypes
● Numbers,
● Strings,
● Booleans,
● null,
● undefined
● Objects ( arrays, functions, regex, objects)
JS OOP Basics - Object
● Objects in JavaScript are class-free.
● Prototypal programing language
●
http://jsfiddle.net/kbalavignesh/4m8kc6gv/
JS OOP Basics -Reference
● Objects are passed around by reference. They are
never copied.
●
http://jsfiddle.net/kbalavignesh/d5g5k0tL/
JS OOP Basics- Prototype
● Object.prototype - an object that comes standard
with JavaScript.
●
http://jsfiddle.net/kbalavignesh/rp68Ln5s/
● Delegation
JS OOP Basics - Global abatement
●
http://jsfiddle.net/kbalavignesh/s6njz5wz/
JS OOP Basics - Functions
● Functions in JavaScript are objects.
● Function objects are linked to Function.prototype
(which is itself linked to Object.prototype ).
● http://jsfiddle.net/kbalavignesh/a92f3aos/
JS OOP Basics -Closure
● A closure is a function having access to the parent
scope, even after the parent function has closed.
●
http://jsfiddle.net/kbalavignesh/xq5qmz9n/
JS OOP Basics -Arrays
● Array.prototype
var empty = [];
var numbers = ['one', 'two'];
console.log(empty.length);
console.log(numbers.length);
Underscore.js
● forEach - iterate over collections
● sortBy() - sort a collection on a specific attribute
● map() - iterate through a collection, mapping each value through a
transformation function
● pluck() - extract a specific attribute
● size() - return the size of a collection
● isEmpty()- determine whether a collection is empty
● groupBy()- group a collection into groups of like items
● pick() - extract a set of attributes from a model
● omit() - extract all attributes from a model except those listed
● keys() and values() - get lists of attribute names and values
● pairs() - get list of attributes as [key, value] pairs
●
http://jsfiddle.net/kbalavignesh/ujq80qm3/20/
Underscore -Micro Template
● pre compiled templates
● other template engines
Mustache, jQuery-tmpl
● how to select - http://garann.github.io/template-chooser/
● http://www.2ality.com/2012/06/underscore-templates.html
● http://stackoverflow.com/questions/13536262/what-is-javascript-template-
precompiling
Backbone Basic Elements
● Model
● Collections
● View
● Router
● Events
Model
● Holds the attributes
● Takes care of Validation
● Persistance
● Announces updates
● id, idAttribute, cid
● Default, set, get values - https://jsfiddle.net/kbalavignesh/ujq80qm3/9/
● Change Event - https://jsfiddle.net/kbalavignesh/ujq80qm3/10/
● Validation - http://jsfiddle.net/kbalavignesh/ujq80qm3/11/
● Complete Validation - http://jsfiddle.net/kbalavignesh/ujq80qm3/12/
Collection
● Holds models
● Announces add/remove/reset/update model
●
Collection - http://jsfiddle.net/kbalavignesh/ujq80qm3/13/
●
Collection get by id - http://jsfiddle.net/kbalavignesh/ujq80qm3/14/
●
Collection events - http://jsfiddle.net/kbalavignesh/ujq80qm3/15/
●
Collection with underscore functions -
http://jsfiddle.net/kbalavignesh/ujq80qm3/16/
●
Collection sort functions - http://jsfiddle.net/kbalavignesh/ujq80qm3/17/
Persistance
● Collection.fetch() => HTTP GET
● Model.save() => HTTP PUT (for existing model)
● Model.save() => HTTP POST (for new model)
● Model.destroy() => HTTP DELETE
● model.save(attrs, {patch: true}) => HTTP PATCH
Event
● Event within object
- http://jsfiddle.net/kbalavignesh/ujq80qm3/18/
● Event across objects
- http://jsfiddle.net/kbalavignesh/ujq80qm3/19/
View
● Logic to present model
● el - el is basically a reference to a DOM element
and all views must have one
Router & History
● Bookmark
● To Share the link
● To enable backbutton
http://backbonetutorials.com/what-is-a-router/#/route/action
Local Storage - HTML5
● Local storage within browser
● Alternative to cookies
● Can save atleast 5MB
● Stored per domain
localStorage.setItem("name", "Bala");
localStorage.getItem("name");
localStorage.removeItem("name");
http://www.w3schools.com/html/html5_webstorage.asp
TODO List - Example
● Demo - http://backbonejs.org/examples/todos/
● ToDo Examples for all Framework - http://todomvc.com/
● Explanation - http://backbonejs.org/docs/todos.html

More Related Content

PPTX
Nightwatch 101 - Salvador Molina
ODP
Migrations
ODP
Drupal Deployment and Essential Development Tools
PPTX
Backbone.js
PDF
JavascriptMVC: Another choice of web framework
PDF
PDF
Drupal 8 for site builders (Андрей Юртаев)
PDF
AngularJS Deep Dives (NYC GDG Apr 2013)
Nightwatch 101 - Salvador Molina
Migrations
Drupal Deployment and Essential Development Tools
Backbone.js
JavascriptMVC: Another choice of web framework
Drupal 8 for site builders (Андрей Юртаев)
AngularJS Deep Dives (NYC GDG Apr 2013)

Similar to Backbone 4.0 (20)

PDF
Backday Xebia : Découvrez Spring Boot sur un cas pratique
PDF
Drools & jBPM Workshop London 2013
PDF
Creating Modular Test-Driven SPAs with Spring and AngularJS
PPT
Tp web
PPT
一种多屏时代的通用 web 应用架构
PDF
Javascript ui for rest services
PDF
Voorhoede - Front-end architecture
PDF
Android gradle-build-system-overview
PDF
AzovDevMeetup 2016 | Angular 2: обзор | Александр Шевнин
PDF
There's a Module for That, MIMA Summit 2010
PDF
Daniel Steigerwald: EsteJS - javascriptové aplikace robusně, modulárně a komf...
PDF
Garelic: Google Analytics as App Performance monitoring
PDF
2016 stop writing javascript frameworks by Joe Gregorio
PDF
Angular.js for beginners
PDF
Get Ready to Become Google Associate Cloud Engineer
PDF
Module, AMD, RequireJS
PDF
The MEAN stack
PDF
Angular 2 vs React
PDF
Using redux and angular 2 with meteor
PDF
Using redux and angular 2 with meteor
Backday Xebia : Découvrez Spring Boot sur un cas pratique
Drools & jBPM Workshop London 2013
Creating Modular Test-Driven SPAs with Spring and AngularJS
Tp web
一种多屏时代的通用 web 应用架构
Javascript ui for rest services
Voorhoede - Front-end architecture
Android gradle-build-system-overview
AzovDevMeetup 2016 | Angular 2: обзор | Александр Шевнин
There's a Module for That, MIMA Summit 2010
Daniel Steigerwald: EsteJS - javascriptové aplikace robusně, modulárně a komf...
Garelic: Google Analytics as App Performance monitoring
2016 stop writing javascript frameworks by Joe Gregorio
Angular.js for beginners
Get Ready to Become Google Associate Cloud Engineer
Module, AMD, RequireJS
The MEAN stack
Angular 2 vs React
Using redux and angular 2 with meteor
Using redux and angular 2 with meteor
Ad

More from Balavignesh Kasinathan (6)

PDF
Introduction to Scrum
PDF
Introduction to Opensource
PDF
Version Management with CVS
PDF
PHP Secure Programming
PDF
Trainer GUI for Tesseract
Introduction to Scrum
Introduction to Opensource
Version Management with CVS
PHP Secure Programming
Trainer GUI for Tesseract
Ad

Recently uploaded (20)

PPTX
WiFi Honeypot Detecscfddssdffsedfseztor.pptx
PDF
Ableton Live Suite for MacOS Crack Full Download (Latest 2025)
PPTX
Trending Python Topics for Data Visualization in 2025
PDF
AI/ML Infra Meetup | Beyond S3's Basics: Architecting for AI-Native Data Access
PDF
DuckDuckGo Private Browser Premium APK for Android Crack Latest 2025
PPTX
Why Generative AI is the Future of Content, Code & Creativity?
PDF
Visual explanation of Dijkstra's Algorithm using Python
PDF
Website Design Services for Small Businesses.pdf
PDF
Product Update: Alluxio AI 3.7 Now with Sub-Millisecond Latency
PDF
MCP Security Tutorial - Beginner to Advanced
PDF
Time Tracking Features That Teams and Organizations Actually Need
PPTX
Introduction to Windows Operating System
PPTX
Cybersecurity: Protecting the Digital World
PDF
Wondershare Recoverit Full Crack New Version (Latest 2025)
PDF
How to Make Money in the Metaverse_ Top Strategies for Beginners.pdf
PDF
Designing Intelligence for the Shop Floor.pdf
PPTX
CNN LeNet5 Architecture: Neural Networks
PDF
EaseUS PDF Editor Pro 6.2.0.2 Crack with License Key 2025
PPTX
"Secure File Sharing Solutions on AWS".pptx
PDF
AI/ML Infra Meetup | LLM Agents and Implementation Challenges
WiFi Honeypot Detecscfddssdffsedfseztor.pptx
Ableton Live Suite for MacOS Crack Full Download (Latest 2025)
Trending Python Topics for Data Visualization in 2025
AI/ML Infra Meetup | Beyond S3's Basics: Architecting for AI-Native Data Access
DuckDuckGo Private Browser Premium APK for Android Crack Latest 2025
Why Generative AI is the Future of Content, Code & Creativity?
Visual explanation of Dijkstra's Algorithm using Python
Website Design Services for Small Businesses.pdf
Product Update: Alluxio AI 3.7 Now with Sub-Millisecond Latency
MCP Security Tutorial - Beginner to Advanced
Time Tracking Features That Teams and Organizations Actually Need
Introduction to Windows Operating System
Cybersecurity: Protecting the Digital World
Wondershare Recoverit Full Crack New Version (Latest 2025)
How to Make Money in the Metaverse_ Top Strategies for Beginners.pdf
Designing Intelligence for the Shop Floor.pdf
CNN LeNet5 Architecture: Neural Networks
EaseUS PDF Editor Pro 6.2.0.2 Crack with License Key 2025
"Secure File Sharing Solutions on AWS".pptx
AI/ML Infra Meetup | LLM Agents and Implementation Challenges

Backbone 4.0

  • 2. Introduction What? Backbone.js Why? Web Applications Demand Whom? Beginners to Intermediate *Beginners => Basic JS + Jquery
  • 3. Plan Day 1: 1.5 hrs JS concepts + Jquery + Underscore library 1.5 hrs Basic Elements of Backbone Day 2: 1 hr Example with Backbone - Local Storage 1 hr Example with Backbone - Persistance 1 hr Boilerplate, RequireJS
  • 4. Goal Understading the necessity of MV* Framework Understanding the basic elements of Backbone Overview on designing web app with backbone Sharing experience / knowledge
  • 5. Resources / Books ● http://backbonejs.org/ ● http://addyosmani.github.io/backbone-fundame ntals/ ● Javascript The Good Parts – Douglas Crockford ● https://developer.mozilla.org/en/Learn/JavaScr ipt
  • 6. Practice http://jsfiddle.net/ ● jquery 2.1.0 ● https://cdnjs.cloudflare.com/ajax/libs/json2/20140204/json2.min.js ● https://cdnjs.cloudflare.com/ajax/libs/underscore.js/1.8.2/underscore- min.js ● https://cdnjs.cloudflare.com/ajax/libs/backbone.js/1.1.2/backbone-min.js
  • 7. Backbone.js ● Author - Jeremy Ashkenas ● Stable Release - 1.1.2 ● License - MIT ● http://backbonejs.org/ ● Dependency Underscore.js -> http://underscorejs.org/
  • 9. Testimonials ● Digg ● LinkedIn Mobile ● Bit Torrent ● Wordpress ● Documentcloud
  • 10. MVC -Design Pattern Image Source - http://addyosmani.github.io/backbone-fundamentals/
  • 11. JS OOP Basics- DataTypes ● Numbers, ● Strings, ● Booleans, ● null, ● undefined ● Objects ( arrays, functions, regex, objects)
  • 12. JS OOP Basics - Object ● Objects in JavaScript are class-free. ● Prototypal programing language ● http://jsfiddle.net/kbalavignesh/4m8kc6gv/
  • 13. JS OOP Basics -Reference ● Objects are passed around by reference. They are never copied. ● http://jsfiddle.net/kbalavignesh/d5g5k0tL/
  • 14. JS OOP Basics- Prototype ● Object.prototype - an object that comes standard with JavaScript. ● http://jsfiddle.net/kbalavignesh/rp68Ln5s/ ● Delegation
  • 15. JS OOP Basics - Global abatement ● http://jsfiddle.net/kbalavignesh/s6njz5wz/
  • 16. JS OOP Basics - Functions ● Functions in JavaScript are objects. ● Function objects are linked to Function.prototype (which is itself linked to Object.prototype ). ● http://jsfiddle.net/kbalavignesh/a92f3aos/
  • 17. JS OOP Basics -Closure ● A closure is a function having access to the parent scope, even after the parent function has closed. ● http://jsfiddle.net/kbalavignesh/xq5qmz9n/
  • 18. JS OOP Basics -Arrays ● Array.prototype var empty = []; var numbers = ['one', 'two']; console.log(empty.length); console.log(numbers.length);
  • 19. Underscore.js ● forEach - iterate over collections ● sortBy() - sort a collection on a specific attribute ● map() - iterate through a collection, mapping each value through a transformation function ● pluck() - extract a specific attribute ● size() - return the size of a collection ● isEmpty()- determine whether a collection is empty ● groupBy()- group a collection into groups of like items ● pick() - extract a set of attributes from a model ● omit() - extract all attributes from a model except those listed ● keys() and values() - get lists of attribute names and values ● pairs() - get list of attributes as [key, value] pairs ● http://jsfiddle.net/kbalavignesh/ujq80qm3/20/
  • 20. Underscore -Micro Template ● pre compiled templates ● other template engines Mustache, jQuery-tmpl ● how to select - http://garann.github.io/template-chooser/ ● http://www.2ality.com/2012/06/underscore-templates.html ● http://stackoverflow.com/questions/13536262/what-is-javascript-template- precompiling
  • 21. Backbone Basic Elements ● Model ● Collections ● View ● Router ● Events
  • 22. Model ● Holds the attributes ● Takes care of Validation ● Persistance ● Announces updates ● id, idAttribute, cid ● Default, set, get values - https://jsfiddle.net/kbalavignesh/ujq80qm3/9/ ● Change Event - https://jsfiddle.net/kbalavignesh/ujq80qm3/10/ ● Validation - http://jsfiddle.net/kbalavignesh/ujq80qm3/11/ ● Complete Validation - http://jsfiddle.net/kbalavignesh/ujq80qm3/12/
  • 23. Collection ● Holds models ● Announces add/remove/reset/update model ● Collection - http://jsfiddle.net/kbalavignesh/ujq80qm3/13/ ● Collection get by id - http://jsfiddle.net/kbalavignesh/ujq80qm3/14/ ● Collection events - http://jsfiddle.net/kbalavignesh/ujq80qm3/15/ ● Collection with underscore functions - http://jsfiddle.net/kbalavignesh/ujq80qm3/16/ ● Collection sort functions - http://jsfiddle.net/kbalavignesh/ujq80qm3/17/
  • 24. Persistance ● Collection.fetch() => HTTP GET ● Model.save() => HTTP PUT (for existing model) ● Model.save() => HTTP POST (for new model) ● Model.destroy() => HTTP DELETE ● model.save(attrs, {patch: true}) => HTTP PATCH
  • 25. Event ● Event within object - http://jsfiddle.net/kbalavignesh/ujq80qm3/18/ ● Event across objects - http://jsfiddle.net/kbalavignesh/ujq80qm3/19/
  • 26. View ● Logic to present model ● el - el is basically a reference to a DOM element and all views must have one
  • 27. Router & History ● Bookmark ● To Share the link ● To enable backbutton http://backbonetutorials.com/what-is-a-router/#/route/action
  • 28. Local Storage - HTML5 ● Local storage within browser ● Alternative to cookies ● Can save atleast 5MB ● Stored per domain localStorage.setItem("name", "Bala"); localStorage.getItem("name"); localStorage.removeItem("name"); http://www.w3schools.com/html/html5_webstorage.asp
  • 29. TODO List - Example ● Demo - http://backbonejs.org/examples/todos/ ● ToDo Examples for all Framework - http://todomvc.com/ ● Explanation - http://backbonejs.org/docs/todos.html