SlideShare a Scribd company logo
1 of 26
Download to read offline
Backbone.js
Introduction / Oren Farhi
Oren Farhi
Front End Architect, JS Engineer @Tikal
JS Group Leader - Meet, Share, Contribute & Coding
Speaker (Israel & World Wide)
Developing with:
Pure Javascript, Backbone.js, Underscore.js, jQuery, CSS3
github.com/tikalk
@tikalk
We help companies build, deliver,
deploy, manage and optimize their products.
JAVA JS RoR.NETALM
“Today we are SURE that we made the right
decision, choosing Tikal”
Guy Ben-Porat - Development Manager “ExLibris”
Tikal by Numbers
“Actions speak louder than words”
Tikal's motto
1600+
Community
Members
150+
Blog Posts
Last Year
460+
Meetup
Members
100+
Projects
Last Year
90+
Tikal’s
Experts Team
12+
Years old
The Past:
JS is the wild west
No code conventions
jQuery bloated code
Data & DOM mixed
jQuery ajax & callbacks are a
bit messy
No Reuse
Most End Result:
words and sentences with
long selectors and "hanged"
functions everywhere
The Present: All we have is now
Simplicity
Organization
Focus
Backbone Background
Jeremy Ashkenas -
Underscore, Coffeescript
DocumentCloud
Dependencies:
jquery / zepto
underscore.js
json2.js ( IE, other without JSON )
Backbone is:
MVC library (MIT)
Structure
RESTful JSON connector
Hash Routing Engine
Event Driven
Extended
Model
Events
View
Collection
Router
Utilities - based underscore.js
Templating Engine - based underscore.js
What is it good for?
Linkedin Mobile, SoundCloud, Foursquar,
Khan Academy, Airbnb, Rdio, Hulu
Structure for Code
Separation of Concerns
Modular, Extensible
Reusable Modules
Loose Coupling
Model Driven
Unit Test Ready
M - Backbone.Model
V - _.template
C - Backbone.View / Router
This is a backbone.
When used properly
It keeps one's head
Out of one's butt
Rand Macivor
What we're going to do today:
https://github.com/tikalk/backbone-workshop
Backbone.Model
Where JSON data is stored
REST, Constructor, Manually
Data Change Events
Works With: Collection, View
Methods:
set - validate
get
escape
clear
fetch
save (REST) - parse
destroy (REST)
Backbone.Model
Backbone.Model - PRACTICE
Model properties: defaults,
Model Methods: initialize, set, get
Backbone.View
A Controller for a DOM Element (wrapper)
Renders Model/Collection to DOM (html)
Delegates DOM Events
Works With: Model, Collection
Can use Any template engine to render
html
Methods:
render (return this)
make
remove
un/delegateEvents
Properties:
$ = $el.find
el
$el
options
events
Backbone.View
Backbone.View - PRACTICE
View properties: events, tagName, className, render
_.Underscore.js
Utilities for Javascript (60)
Collections, Arrays, Functions, Objects,
Uses Browsers Implementation if possible
High Expressiveness
Works With: Backbone, Standalone
Methods:
Collections - each, map, filter, pluck,
groupBy
Arrays - without, uniq
Functions - bind, debounce,
Object - keys, values, is-* (Empty, Date,
String, Function etc..), has
Utility - template, escape, mixin
Chaining - chain, value
_.Underscore.js
Backbone.Collection
Collection of Models
REST, Constructor, Manually
Inherits Change Events from Models
Works With: Model, View
Many utilities methods from underscore.js
Methods:
add
remove
length
fetch
save (REST) - parse
destroy (REST)
+ 28 Underscore methods:
map, find, filter, sortBy, groupBy, pluck,
invoke ...
Properties:
options
Backbone.Collection
Backbone.Collection - PRACTICE
Backbone.Router
Navigation Handling (bookmarks)
Listens to url change events
Natively integrated to Back/Forward
Easy routing handling
Works With: Backbone.History
Methods:
custom
navigate
route (create)
Properties:
routes (key - value) - (route - handler)
Backbone.Router
Backbone.Router - PRACTICE
Questions?
Backbone - http://documentcloud.github.com/backbone/
Underscore - http://documentcloud.github.com/underscore
Tikal - http://www.tikalk.com

More Related Content

What's hot

The MEAN Stack: MongoDB, ExpressJS, AngularJS and Node.js
The MEAN Stack: MongoDB, ExpressJS, AngularJS and Node.jsThe MEAN Stack: MongoDB, ExpressJS, AngularJS and Node.js
The MEAN Stack: MongoDB, ExpressJS, AngularJS and Node.jsMongoDB
 
Rails + Sencha = Netzke
Rails + Sencha = NetzkeRails + Sencha = Netzke
Rails + Sencha = Netzkebeffa
 
Backbone & React Together Forever
Backbone & React Together ForeverBackbone & React Together Forever
Backbone & React Together ForeverSamuel Breed
 
03 Web Events and jQuery
03 Web Events and jQuery03 Web Events and jQuery
03 Web Events and jQuerycrgwbr
 
jQuery Conference San Diego 2014 - Web Performance
jQuery Conference San Diego 2014 - Web PerformancejQuery Conference San Diego 2014 - Web Performance
jQuery Conference San Diego 2014 - Web Performancedmethvin
 
Javascript why what and how
Javascript why what and howJavascript why what and how
Javascript why what and howsureshpraja1234
 
The New UI - Staying Strong with Flexbox, SASS, and {{Mustache.js}}
The New UI - Staying Strong with Flexbox, SASS, and {{Mustache.js}}The New UI - Staying Strong with Flexbox, SASS, and {{Mustache.js}}
The New UI - Staying Strong with Flexbox, SASS, and {{Mustache.js}}Eric Carlisle
 
HTTP 2.0 - Web Unleashed 2015
HTTP 2.0 - Web Unleashed 2015HTTP 2.0 - Web Unleashed 2015
HTTP 2.0 - Web Unleashed 2015dmethvin
 
MongoDB and the MEAN Stack
MongoDB and the MEAN StackMongoDB and the MEAN Stack
MongoDB and the MEAN StackMongoDB
 
jQuery - Boston IxDA
jQuery - Boston IxDAjQuery - Boston IxDA
jQuery - Boston IxDAjeresig
 
Third-Party Libraries — Adam Klein
Third-Party Libraries — Adam KleinThird-Party Libraries — Adam Klein
Third-Party Libraries — Adam Klein500Tech
 
Backbone js in drupal core
Backbone js in drupal coreBackbone js in drupal core
Backbone js in drupal coreMarcin Wosinek
 
jQuery Conference Toronto
jQuery Conference TorontojQuery Conference Toronto
jQuery Conference Torontodmethvin
 
Offline first, the painless way
Offline first, the painless wayOffline first, the painless way
Offline first, the painless wayMarcel Kalveram
 
New Perspectives on Performance
New Perspectives on PerformanceNew Perspectives on Performance
New Perspectives on Performancemennovanslooten
 

What's hot (20)

The MEAN Stack: MongoDB, ExpressJS, AngularJS and Node.js
The MEAN Stack: MongoDB, ExpressJS, AngularJS and Node.jsThe MEAN Stack: MongoDB, ExpressJS, AngularJS and Node.js
The MEAN Stack: MongoDB, ExpressJS, AngularJS and Node.js
 
Rails + Sencha = Netzke
Rails + Sencha = NetzkeRails + Sencha = Netzke
Rails + Sencha = Netzke
 
BackboneJs
BackboneJsBackboneJs
BackboneJs
 
Backbone & React Together Forever
Backbone & React Together ForeverBackbone & React Together Forever
Backbone & React Together Forever
 
03 Web Events and jQuery
03 Web Events and jQuery03 Web Events and jQuery
03 Web Events and jQuery
 
jQuery Conference San Diego 2014 - Web Performance
jQuery Conference San Diego 2014 - Web PerformancejQuery Conference San Diego 2014 - Web Performance
jQuery Conference San Diego 2014 - Web Performance
 
Why NodeJS
Why NodeJSWhy NodeJS
Why NodeJS
 
Javascript why what and how
Javascript why what and howJavascript why what and how
Javascript why what and how
 
The New UI - Staying Strong with Flexbox, SASS, and {{Mustache.js}}
The New UI - Staying Strong with Flexbox, SASS, and {{Mustache.js}}The New UI - Staying Strong with Flexbox, SASS, and {{Mustache.js}}
The New UI - Staying Strong with Flexbox, SASS, and {{Mustache.js}}
 
HTTP 2.0 - Web Unleashed 2015
HTTP 2.0 - Web Unleashed 2015HTTP 2.0 - Web Unleashed 2015
HTTP 2.0 - Web Unleashed 2015
 
MongoDB and the MEAN Stack
MongoDB and the MEAN StackMongoDB and the MEAN Stack
MongoDB and the MEAN Stack
 
jQuery - Boston IxDA
jQuery - Boston IxDAjQuery - Boston IxDA
jQuery - Boston IxDA
 
3rd party
3rd party3rd party
3rd party
 
Third-Party Libraries — Adam Klein
Third-Party Libraries — Adam KleinThird-Party Libraries — Adam Klein
Third-Party Libraries — Adam Klein
 
Backbone js in drupal core
Backbone js in drupal coreBackbone js in drupal core
Backbone js in drupal core
 
Node.js with WebMatrix
Node.js with WebMatrixNode.js with WebMatrix
Node.js with WebMatrix
 
jQuery Conference Toronto
jQuery Conference TorontojQuery Conference Toronto
jQuery Conference Toronto
 
Backbonejs on Rails
Backbonejs on RailsBackbonejs on Rails
Backbonejs on Rails
 
Offline first, the painless way
Offline first, the painless wayOffline first, the painless way
Offline first, the painless way
 
New Perspectives on Performance
New Perspectives on PerformanceNew Perspectives on Performance
New Perspectives on Performance
 

Viewers also liked

Introduction To Backbone JS
Introduction To Backbone JSIntroduction To Backbone JS
Introduction To Backbone JSparamisoft
 
Introduction to Backbone.js
Introduction to Backbone.jsIntroduction to Backbone.js
Introduction to Backbone.jsPragnesh Vaghela
 
Structuring web applications with Backbone.js
Structuring web applications with Backbone.jsStructuring web applications with Backbone.js
Structuring web applications with Backbone.jsDiego Cardozo
 
Writing HTML5 Web Apps using Backbone.js and GAE
Writing HTML5 Web Apps using Backbone.js and GAEWriting HTML5 Web Apps using Backbone.js and GAE
Writing HTML5 Web Apps using Backbone.js and GAERon Reiter
 
OPTIMIZATION OF WIRE EDM PARAMETERS TO ACHIEVE A FINE SURFACE FINISH
OPTIMIZATION OF WIRE EDM PARAMETERS TO ACHIEVE A FINE SURFACE FINISHOPTIMIZATION OF WIRE EDM PARAMETERS TO ACHIEVE A FINE SURFACE FINISH
OPTIMIZATION OF WIRE EDM PARAMETERS TO ACHIEVE A FINE SURFACE FINISHIjripublishers Ijri
 
OPTIMIZATIONS OF MACHINING PARAMETER IN WIRE EDM FOR 316L STAINLESS STEEL BY ...
OPTIMIZATIONS OF MACHINING PARAMETER IN WIRE EDM FOR 316L STAINLESS STEEL BY ...OPTIMIZATIONS OF MACHINING PARAMETER IN WIRE EDM FOR 316L STAINLESS STEEL BY ...
OPTIMIZATIONS OF MACHINING PARAMETER IN WIRE EDM FOR 316L STAINLESS STEEL BY ...IAEME Publication
 
RSS (Really Simple Syndication)
RSS (Really Simple Syndication)RSS (Really Simple Syndication)
RSS (Really Simple Syndication)nimitjohri
 
Edm Wire Cut
Edm Wire CutEdm Wire Cut
Edm Wire Cutmrg timoq
 
What Is A Podcast
What Is A PodcastWhat Is A Podcast
What Is A Podcastkwilfert
 
Enterprise Application Integration
Enterprise Application IntegrationEnterprise Application Integration
Enterprise Application IntegrationComputing Cage
 
Topic3 Enterprise Application Integration
Topic3 Enterprise Application IntegrationTopic3 Enterprise Application Integration
Topic3 Enterprise Application Integrationsanjoysanyal
 
Edm wire cut presentation
Edm wire cut presentationEdm wire cut presentation
Edm wire cut presentationmohdazliabu
 
What is Server? (Web Server vs Application Server)
What is Server? (Web Server vs Application Server)What is Server? (Web Server vs Application Server)
What is Server? (Web Server vs Application Server)Amit Nirala
 

Viewers also liked (20)

Introduction To Backbone JS
Introduction To Backbone JSIntroduction To Backbone JS
Introduction To Backbone JS
 
Introduction to Backbone.js
Introduction to Backbone.jsIntroduction to Backbone.js
Introduction to Backbone.js
 
Structuring web applications with Backbone.js
Structuring web applications with Backbone.jsStructuring web applications with Backbone.js
Structuring web applications with Backbone.js
 
Writing HTML5 Web Apps using Backbone.js and GAE
Writing HTML5 Web Apps using Backbone.js and GAEWriting HTML5 Web Apps using Backbone.js and GAE
Writing HTML5 Web Apps using Backbone.js and GAE
 
Backbone.js
Backbone.jsBackbone.js
Backbone.js
 
Backbone Basics with Examples
Backbone Basics with ExamplesBackbone Basics with Examples
Backbone Basics with Examples
 
Edm wire cut report
Edm wire cut reportEdm wire cut report
Edm wire cut report
 
OPTIMIZATION OF WIRE EDM PARAMETERS TO ACHIEVE A FINE SURFACE FINISH
OPTIMIZATION OF WIRE EDM PARAMETERS TO ACHIEVE A FINE SURFACE FINISHOPTIMIZATION OF WIRE EDM PARAMETERS TO ACHIEVE A FINE SURFACE FINISH
OPTIMIZATION OF WIRE EDM PARAMETERS TO ACHIEVE A FINE SURFACE FINISH
 
Sockets and rails
Sockets and railsSockets and rails
Sockets and rails
 
OPTIMIZATIONS OF MACHINING PARAMETER IN WIRE EDM FOR 316L STAINLESS STEEL BY ...
OPTIMIZATIONS OF MACHINING PARAMETER IN WIRE EDM FOR 316L STAINLESS STEEL BY ...OPTIMIZATIONS OF MACHINING PARAMETER IN WIRE EDM FOR 316L STAINLESS STEEL BY ...
OPTIMIZATIONS OF MACHINING PARAMETER IN WIRE EDM FOR 316L STAINLESS STEEL BY ...
 
Wire cut edm
Wire cut edmWire cut edm
Wire cut edm
 
Lectores RSS
Lectores RSSLectores RSS
Lectores RSS
 
RSS (Really Simple Syndication)
RSS (Really Simple Syndication)RSS (Really Simple Syndication)
RSS (Really Simple Syndication)
 
Edm Wire Cut
Edm Wire CutEdm Wire Cut
Edm Wire Cut
 
Podcast Presentation
Podcast PresentationPodcast Presentation
Podcast Presentation
 
What Is A Podcast
What Is A PodcastWhat Is A Podcast
What Is A Podcast
 
Enterprise Application Integration
Enterprise Application IntegrationEnterprise Application Integration
Enterprise Application Integration
 
Topic3 Enterprise Application Integration
Topic3 Enterprise Application IntegrationTopic3 Enterprise Application Integration
Topic3 Enterprise Application Integration
 
Edm wire cut presentation
Edm wire cut presentationEdm wire cut presentation
Edm wire cut presentation
 
What is Server? (Web Server vs Application Server)
What is Server? (Web Server vs Application Server)What is Server? (Web Server vs Application Server)
What is Server? (Web Server vs Application Server)
 

Similar to Backbone.js Introduction and Overview

Tikal's Backbone_js introduction workshop
Tikal's Backbone_js introduction workshopTikal's Backbone_js introduction workshop
Tikal's Backbone_js introduction workshopTikal Knowledge
 
jQuery Makes Writing JavaScript Fun Again (for HTML5 User Group)
jQuery Makes Writing JavaScript Fun Again (for HTML5 User Group)jQuery Makes Writing JavaScript Fun Again (for HTML5 User Group)
jQuery Makes Writing JavaScript Fun Again (for HTML5 User Group)Doris Chen
 
SXSW 2012 JavaScript MythBusters
SXSW 2012 JavaScript MythBustersSXSW 2012 JavaScript MythBusters
SXSW 2012 JavaScript MythBustersElena-Oana Tabaranu
 
RubyEnRails2007 - Dr Nic Williams - Keynote
RubyEnRails2007 - Dr Nic Williams - KeynoteRubyEnRails2007 - Dr Nic Williams - Keynote
RubyEnRails2007 - Dr Nic Williams - KeynoteDr Nic Williams
 
JRuby + Rails = Awesome Java Web Framework at Jfokus 2011
JRuby + Rails = Awesome Java Web Framework at Jfokus 2011JRuby + Rails = Awesome Java Web Framework at Jfokus 2011
JRuby + Rails = Awesome Java Web Framework at Jfokus 2011Nick Sieger
 
Backbone web apps - design & architecture
Backbone web apps  - design & architectureBackbone web apps  - design & architecture
Backbone web apps - design & architectureOren Farhi
 
Backbone.js Architecture Example - Echoes Media Player (Hebrew)
Backbone.js Architecture Example - Echoes Media Player (Hebrew)Backbone.js Architecture Example - Echoes Media Player (Hebrew)
Backbone.js Architecture Example - Echoes Media Player (Hebrew)Yifat Kanfi
 
Intro to React - Featuring Modern JavaScript
Intro to React - Featuring Modern JavaScriptIntro to React - Featuring Modern JavaScript
Intro to React - Featuring Modern JavaScriptjasonsich
 
Hadoop and Marklogic: Using the Genetic Algorithm to generate Source Code
Hadoop and Marklogic: Using the Genetic Algorithm to generate Source CodeHadoop and Marklogic: Using the Genetic Algorithm to generate Source Code
Hadoop and Marklogic: Using the Genetic Algorithm to generate Source Codejimfuller2009
 
Intro to-html-backbone
Intro to-html-backboneIntro to-html-backbone
Intro to-html-backbonezonathen
 
jQuery in the [Aol.] Enterprise
jQuery in the [Aol.] EnterprisejQuery in the [Aol.] Enterprise
jQuery in the [Aol.] EnterpriseDave Artz
 
WebNet Conference 2012 - Designing complex applications using html5 and knock...
WebNet Conference 2012 - Designing complex applications using html5 and knock...WebNet Conference 2012 - Designing complex applications using html5 and knock...
WebNet Conference 2012 - Designing complex applications using html5 and knock...Fabio Franzini
 
Introduction to MongoDB
Introduction to MongoDBIntroduction to MongoDB
Introduction to MongoDBJustin Smestad
 
1.6 米嘉 gobuildweb
1.6 米嘉 gobuildweb1.6 米嘉 gobuildweb
1.6 米嘉 gobuildwebLeo Zhou
 
EuRuKo JRuby Talk 2008
EuRuKo JRuby Talk 2008EuRuKo JRuby Talk 2008
EuRuKo JRuby Talk 2008geraldbauer
 
jQuery - the world's most popular java script library comes to XPages
jQuery - the world's most popular java script library comes to XPagesjQuery - the world's most popular java script library comes to XPages
jQuery - the world's most popular java script library comes to XPagesMark Roden
 
Drupal Theme Development - DrupalCon Chicago 2011
Drupal Theme Development - DrupalCon Chicago 2011Drupal Theme Development - DrupalCon Chicago 2011
Drupal Theme Development - DrupalCon Chicago 2011Ryan Price
 
Starting with jQuery
Starting with jQueryStarting with jQuery
Starting with jQueryAnil Kumar
 
Organized web app development using backbone.js
Organized web app development using backbone.jsOrganized web app development using backbone.js
Organized web app development using backbone.jsShakti Shrestha
 

Similar to Backbone.js Introduction and Overview (20)

Tikal's Backbone_js introduction workshop
Tikal's Backbone_js introduction workshopTikal's Backbone_js introduction workshop
Tikal's Backbone_js introduction workshop
 
jQuery Makes Writing JavaScript Fun Again (for HTML5 User Group)
jQuery Makes Writing JavaScript Fun Again (for HTML5 User Group)jQuery Makes Writing JavaScript Fun Again (for HTML5 User Group)
jQuery Makes Writing JavaScript Fun Again (for HTML5 User Group)
 
Play framework
Play frameworkPlay framework
Play framework
 
SXSW 2012 JavaScript MythBusters
SXSW 2012 JavaScript MythBustersSXSW 2012 JavaScript MythBusters
SXSW 2012 JavaScript MythBusters
 
RubyEnRails2007 - Dr Nic Williams - Keynote
RubyEnRails2007 - Dr Nic Williams - KeynoteRubyEnRails2007 - Dr Nic Williams - Keynote
RubyEnRails2007 - Dr Nic Williams - Keynote
 
JRuby + Rails = Awesome Java Web Framework at Jfokus 2011
JRuby + Rails = Awesome Java Web Framework at Jfokus 2011JRuby + Rails = Awesome Java Web Framework at Jfokus 2011
JRuby + Rails = Awesome Java Web Framework at Jfokus 2011
 
Backbone web apps - design & architecture
Backbone web apps  - design & architectureBackbone web apps  - design & architecture
Backbone web apps - design & architecture
 
Backbone.js Architecture Example - Echoes Media Player (Hebrew)
Backbone.js Architecture Example - Echoes Media Player (Hebrew)Backbone.js Architecture Example - Echoes Media Player (Hebrew)
Backbone.js Architecture Example - Echoes Media Player (Hebrew)
 
Intro to React - Featuring Modern JavaScript
Intro to React - Featuring Modern JavaScriptIntro to React - Featuring Modern JavaScript
Intro to React - Featuring Modern JavaScript
 
Hadoop and Marklogic: Using the Genetic Algorithm to generate Source Code
Hadoop and Marklogic: Using the Genetic Algorithm to generate Source CodeHadoop and Marklogic: Using the Genetic Algorithm to generate Source Code
Hadoop and Marklogic: Using the Genetic Algorithm to generate Source Code
 
Intro to-html-backbone
Intro to-html-backboneIntro to-html-backbone
Intro to-html-backbone
 
jQuery in the [Aol.] Enterprise
jQuery in the [Aol.] EnterprisejQuery in the [Aol.] Enterprise
jQuery in the [Aol.] Enterprise
 
WebNet Conference 2012 - Designing complex applications using html5 and knock...
WebNet Conference 2012 - Designing complex applications using html5 and knock...WebNet Conference 2012 - Designing complex applications using html5 and knock...
WebNet Conference 2012 - Designing complex applications using html5 and knock...
 
Introduction to MongoDB
Introduction to MongoDBIntroduction to MongoDB
Introduction to MongoDB
 
1.6 米嘉 gobuildweb
1.6 米嘉 gobuildweb1.6 米嘉 gobuildweb
1.6 米嘉 gobuildweb
 
EuRuKo JRuby Talk 2008
EuRuKo JRuby Talk 2008EuRuKo JRuby Talk 2008
EuRuKo JRuby Talk 2008
 
jQuery - the world's most popular java script library comes to XPages
jQuery - the world's most popular java script library comes to XPagesjQuery - the world's most popular java script library comes to XPages
jQuery - the world's most popular java script library comes to XPages
 
Drupal Theme Development - DrupalCon Chicago 2011
Drupal Theme Development - DrupalCon Chicago 2011Drupal Theme Development - DrupalCon Chicago 2011
Drupal Theme Development - DrupalCon Chicago 2011
 
Starting with jQuery
Starting with jQueryStarting with jQuery
Starting with jQuery
 
Organized web app development using backbone.js
Organized web app development using backbone.jsOrganized web app development using backbone.js
Organized web app development using backbone.js
 

Recently uploaded

Active Learning Strategies (in short ALS).pdf
Active Learning Strategies (in short ALS).pdfActive Learning Strategies (in short ALS).pdf
Active Learning Strategies (in short ALS).pdfPatidar M
 
Multi Domain Alias In the Odoo 17 ERP Module
Multi Domain Alias In the Odoo 17 ERP ModuleMulti Domain Alias In the Odoo 17 ERP Module
Multi Domain Alias In the Odoo 17 ERP ModuleCeline George
 
Man or Manufactured_ Redefining Humanity Through Biopunk Narratives.pptx
Man or Manufactured_ Redefining Humanity Through Biopunk Narratives.pptxMan or Manufactured_ Redefining Humanity Through Biopunk Narratives.pptx
Man or Manufactured_ Redefining Humanity Through Biopunk Narratives.pptxDhatriParmar
 
Narcotic and Non Narcotic Analgesic..pdf
Narcotic and Non Narcotic Analgesic..pdfNarcotic and Non Narcotic Analgesic..pdf
Narcotic and Non Narcotic Analgesic..pdfPrerana Jadhav
 
4.11.24 Mass Incarceration and the New Jim Crow.pptx
4.11.24 Mass Incarceration and the New Jim Crow.pptx4.11.24 Mass Incarceration and the New Jim Crow.pptx
4.11.24 Mass Incarceration and the New Jim Crow.pptxmary850239
 
How to Fix XML SyntaxError in Odoo the 17
How to Fix XML SyntaxError in Odoo the 17How to Fix XML SyntaxError in Odoo the 17
How to Fix XML SyntaxError in Odoo the 17Celine George
 
Unraveling Hypertext_ Analyzing Postmodern Elements in Literature.pptx
Unraveling Hypertext_ Analyzing  Postmodern Elements in  Literature.pptxUnraveling Hypertext_ Analyzing  Postmodern Elements in  Literature.pptx
Unraveling Hypertext_ Analyzing Postmodern Elements in Literature.pptxDhatriParmar
 
Grade Three -ELLNA-REVIEWER-ENGLISH.pptx
Grade Three -ELLNA-REVIEWER-ENGLISH.pptxGrade Three -ELLNA-REVIEWER-ENGLISH.pptx
Grade Three -ELLNA-REVIEWER-ENGLISH.pptxkarenfajardo43
 
Q-Factor HISPOL Quiz-6th April 2024, Quiz Club NITW
Q-Factor HISPOL Quiz-6th April 2024, Quiz Club NITWQ-Factor HISPOL Quiz-6th April 2024, Quiz Club NITW
Q-Factor HISPOL Quiz-6th April 2024, Quiz Club NITWQuiz Club NITW
 
Visit to a blind student's school🧑‍🦯🧑‍🦯(community medicine)
Visit to a blind student's school🧑‍🦯🧑‍🦯(community medicine)Visit to a blind student's school🧑‍🦯🧑‍🦯(community medicine)
Visit to a blind student's school🧑‍🦯🧑‍🦯(community medicine)lakshayb543
 
MS4 level being good citizen -imperative- (1) (1).pdf
MS4 level   being good citizen -imperative- (1) (1).pdfMS4 level   being good citizen -imperative- (1) (1).pdf
MS4 level being good citizen -imperative- (1) (1).pdfMr Bounab Samir
 
Student Profile Sample - We help schools to connect the data they have, with ...
Student Profile Sample - We help schools to connect the data they have, with ...Student Profile Sample - We help schools to connect the data they have, with ...
Student Profile Sample - We help schools to connect the data they have, with ...Seán Kennedy
 
31 ĐỀ THI THỬ VÀO LỚP 10 - TIẾNG ANH - FORM MỚI 2025 - 40 CÂU HỎI - BÙI VĂN V...
31 ĐỀ THI THỬ VÀO LỚP 10 - TIẾNG ANH - FORM MỚI 2025 - 40 CÂU HỎI - BÙI VĂN V...31 ĐỀ THI THỬ VÀO LỚP 10 - TIẾNG ANH - FORM MỚI 2025 - 40 CÂU HỎI - BÙI VĂN V...
31 ĐỀ THI THỬ VÀO LỚP 10 - TIẾNG ANH - FORM MỚI 2025 - 40 CÂU HỎI - BÙI VĂN V...Nguyen Thanh Tu Collection
 
week 1 cookery 8 fourth - quarter .pptx
week 1 cookery 8  fourth  -  quarter .pptxweek 1 cookery 8  fourth  -  quarter .pptx
week 1 cookery 8 fourth - quarter .pptxJonalynLegaspi2
 
Concurrency Control in Database Management system
Concurrency Control in Database Management systemConcurrency Control in Database Management system
Concurrency Control in Database Management systemChristalin Nelson
 
Congestive Cardiac Failure..presentation
Congestive Cardiac Failure..presentationCongestive Cardiac Failure..presentation
Congestive Cardiac Failure..presentationdeepaannamalai16
 
4.11.24 Poverty and Inequality in America.pptx
4.11.24 Poverty and Inequality in America.pptx4.11.24 Poverty and Inequality in America.pptx
4.11.24 Poverty and Inequality in America.pptxmary850239
 
Using Grammatical Signals Suitable to Patterns of Idea Development
Using Grammatical Signals Suitable to Patterns of Idea DevelopmentUsing Grammatical Signals Suitable to Patterns of Idea Development
Using Grammatical Signals Suitable to Patterns of Idea Developmentchesterberbo7
 

Recently uploaded (20)

Paradigm shift in nursing research by RS MEHTA
Paradigm shift in nursing research by RS MEHTAParadigm shift in nursing research by RS MEHTA
Paradigm shift in nursing research by RS MEHTA
 
Active Learning Strategies (in short ALS).pdf
Active Learning Strategies (in short ALS).pdfActive Learning Strategies (in short ALS).pdf
Active Learning Strategies (in short ALS).pdf
 
Multi Domain Alias In the Odoo 17 ERP Module
Multi Domain Alias In the Odoo 17 ERP ModuleMulti Domain Alias In the Odoo 17 ERP Module
Multi Domain Alias In the Odoo 17 ERP Module
 
Man or Manufactured_ Redefining Humanity Through Biopunk Narratives.pptx
Man or Manufactured_ Redefining Humanity Through Biopunk Narratives.pptxMan or Manufactured_ Redefining Humanity Through Biopunk Narratives.pptx
Man or Manufactured_ Redefining Humanity Through Biopunk Narratives.pptx
 
Narcotic and Non Narcotic Analgesic..pdf
Narcotic and Non Narcotic Analgesic..pdfNarcotic and Non Narcotic Analgesic..pdf
Narcotic and Non Narcotic Analgesic..pdf
 
4.11.24 Mass Incarceration and the New Jim Crow.pptx
4.11.24 Mass Incarceration and the New Jim Crow.pptx4.11.24 Mass Incarceration and the New Jim Crow.pptx
4.11.24 Mass Incarceration and the New Jim Crow.pptx
 
How to Fix XML SyntaxError in Odoo the 17
How to Fix XML SyntaxError in Odoo the 17How to Fix XML SyntaxError in Odoo the 17
How to Fix XML SyntaxError in Odoo the 17
 
Unraveling Hypertext_ Analyzing Postmodern Elements in Literature.pptx
Unraveling Hypertext_ Analyzing  Postmodern Elements in  Literature.pptxUnraveling Hypertext_ Analyzing  Postmodern Elements in  Literature.pptx
Unraveling Hypertext_ Analyzing Postmodern Elements in Literature.pptx
 
Grade Three -ELLNA-REVIEWER-ENGLISH.pptx
Grade Three -ELLNA-REVIEWER-ENGLISH.pptxGrade Three -ELLNA-REVIEWER-ENGLISH.pptx
Grade Three -ELLNA-REVIEWER-ENGLISH.pptx
 
Q-Factor HISPOL Quiz-6th April 2024, Quiz Club NITW
Q-Factor HISPOL Quiz-6th April 2024, Quiz Club NITWQ-Factor HISPOL Quiz-6th April 2024, Quiz Club NITW
Q-Factor HISPOL Quiz-6th April 2024, Quiz Club NITW
 
Visit to a blind student's school🧑‍🦯🧑‍🦯(community medicine)
Visit to a blind student's school🧑‍🦯🧑‍🦯(community medicine)Visit to a blind student's school🧑‍🦯🧑‍🦯(community medicine)
Visit to a blind student's school🧑‍🦯🧑‍🦯(community medicine)
 
INCLUSIVE EDUCATION PRACTICES FOR TEACHERS AND TRAINERS.pptx
INCLUSIVE EDUCATION PRACTICES FOR TEACHERS AND TRAINERS.pptxINCLUSIVE EDUCATION PRACTICES FOR TEACHERS AND TRAINERS.pptx
INCLUSIVE EDUCATION PRACTICES FOR TEACHERS AND TRAINERS.pptx
 
MS4 level being good citizen -imperative- (1) (1).pdf
MS4 level   being good citizen -imperative- (1) (1).pdfMS4 level   being good citizen -imperative- (1) (1).pdf
MS4 level being good citizen -imperative- (1) (1).pdf
 
Student Profile Sample - We help schools to connect the data they have, with ...
Student Profile Sample - We help schools to connect the data they have, with ...Student Profile Sample - We help schools to connect the data they have, with ...
Student Profile Sample - We help schools to connect the data they have, with ...
 
31 ĐỀ THI THỬ VÀO LỚP 10 - TIẾNG ANH - FORM MỚI 2025 - 40 CÂU HỎI - BÙI VĂN V...
31 ĐỀ THI THỬ VÀO LỚP 10 - TIẾNG ANH - FORM MỚI 2025 - 40 CÂU HỎI - BÙI VĂN V...31 ĐỀ THI THỬ VÀO LỚP 10 - TIẾNG ANH - FORM MỚI 2025 - 40 CÂU HỎI - BÙI VĂN V...
31 ĐỀ THI THỬ VÀO LỚP 10 - TIẾNG ANH - FORM MỚI 2025 - 40 CÂU HỎI - BÙI VĂN V...
 
week 1 cookery 8 fourth - quarter .pptx
week 1 cookery 8  fourth  -  quarter .pptxweek 1 cookery 8  fourth  -  quarter .pptx
week 1 cookery 8 fourth - quarter .pptx
 
Concurrency Control in Database Management system
Concurrency Control in Database Management systemConcurrency Control in Database Management system
Concurrency Control in Database Management system
 
Congestive Cardiac Failure..presentation
Congestive Cardiac Failure..presentationCongestive Cardiac Failure..presentation
Congestive Cardiac Failure..presentation
 
4.11.24 Poverty and Inequality in America.pptx
4.11.24 Poverty and Inequality in America.pptx4.11.24 Poverty and Inequality in America.pptx
4.11.24 Poverty and Inequality in America.pptx
 
Using Grammatical Signals Suitable to Patterns of Idea Development
Using Grammatical Signals Suitable to Patterns of Idea DevelopmentUsing Grammatical Signals Suitable to Patterns of Idea Development
Using Grammatical Signals Suitable to Patterns of Idea Development
 

Backbone.js Introduction and Overview

  • 2. Oren Farhi Front End Architect, JS Engineer @Tikal JS Group Leader - Meet, Share, Contribute & Coding Speaker (Israel & World Wide) Developing with: Pure Javascript, Backbone.js, Underscore.js, jQuery, CSS3 github.com/tikalk @tikalk
  • 3. We help companies build, deliver, deploy, manage and optimize their products. JAVA JS RoR.NETALM “Today we are SURE that we made the right decision, choosing Tikal” Guy Ben-Porat - Development Manager “ExLibris”
  • 4. Tikal by Numbers “Actions speak louder than words” Tikal's motto 1600+ Community Members 150+ Blog Posts Last Year 460+ Meetup Members 100+ Projects Last Year 90+ Tikal’s Experts Team 12+ Years old
  • 5. The Past: JS is the wild west No code conventions jQuery bloated code Data & DOM mixed jQuery ajax & callbacks are a bit messy No Reuse Most End Result: words and sentences with long selectors and "hanged" functions everywhere
  • 6. The Present: All we have is now Simplicity Organization Focus
  • 7. Backbone Background Jeremy Ashkenas - Underscore, Coffeescript DocumentCloud Dependencies: jquery / zepto underscore.js json2.js ( IE, other without JSON )
  • 8. Backbone is: MVC library (MIT) Structure RESTful JSON connector Hash Routing Engine Event Driven Extended Model Events View Collection Router Utilities - based underscore.js Templating Engine - based underscore.js
  • 9. What is it good for? Linkedin Mobile, SoundCloud, Foursquar, Khan Academy, Airbnb, Rdio, Hulu Structure for Code Separation of Concerns Modular, Extensible Reusable Modules Loose Coupling Model Driven Unit Test Ready M - Backbone.Model V - _.template C - Backbone.View / Router
  • 10. This is a backbone. When used properly It keeps one's head Out of one's butt Rand Macivor
  • 11. What we're going to do today: https://github.com/tikalk/backbone-workshop
  • 12. Backbone.Model Where JSON data is stored REST, Constructor, Manually Data Change Events Works With: Collection, View Methods: set - validate get escape clear fetch save (REST) - parse destroy (REST)
  • 14. Backbone.Model - PRACTICE Model properties: defaults, Model Methods: initialize, set, get
  • 15. Backbone.View A Controller for a DOM Element (wrapper) Renders Model/Collection to DOM (html) Delegates DOM Events Works With: Model, Collection Can use Any template engine to render html Methods: render (return this) make remove un/delegateEvents Properties: $ = $el.find el $el options events
  • 17. Backbone.View - PRACTICE View properties: events, tagName, className, render
  • 18. _.Underscore.js Utilities for Javascript (60) Collections, Arrays, Functions, Objects, Uses Browsers Implementation if possible High Expressiveness Works With: Backbone, Standalone Methods: Collections - each, map, filter, pluck, groupBy Arrays - without, uniq Functions - bind, debounce, Object - keys, values, is-* (Empty, Date, String, Function etc..), has Utility - template, escape, mixin Chaining - chain, value
  • 20. Backbone.Collection Collection of Models REST, Constructor, Manually Inherits Change Events from Models Works With: Model, View Many utilities methods from underscore.js Methods: add remove length fetch save (REST) - parse destroy (REST) + 28 Underscore methods: map, find, filter, sortBy, groupBy, pluck, invoke ... Properties: options
  • 23. Backbone.Router Navigation Handling (bookmarks) Listens to url change events Natively integrated to Back/Forward Easy routing handling Works With: Backbone.History Methods: custom navigate route (create) Properties: routes (key - value) - (route - handler)
  • 26. Questions? Backbone - http://documentcloud.github.com/backbone/ Underscore - http://documentcloud.github.com/underscore Tikal - http://www.tikalk.com