SlideShare a Scribd company logo
Azat Mardanov
Engineer, Storify.com
INTRODUCTION
TO BACKBONE.JS
Saturday, February 2, 13
AGENDA
‣ History, Problems and Solutions
‣ Brief Overview of Backbone Components
‣ Building Backbone App From Scratch
‣ Backbone Starter Kit
‣ Subviews
‣ AMD
2
Saturday, February 2, 13
INTRODUCTION
‣ Over 12 years in software development
‣ Author of RapidPrototypingWithJS.com
‣ 500 Startups grad (Gizmo)
AZAT MARDANOV
ENGINEER, STORIFY
3
@azat_co
azat.co
Saturday, February 2, 13
INTRODUCTION TO BACKBONE.JS
HISTORY,
PROBLEMS
AND
SOLUTIONS
4
Saturday, February 2, 13
HISTORY, PROBLEMS AND SOLUTIONS
HISTORY
1. Before: Pure HTML from the server, client just a painting instructions
2. Some client code to style (DHTML, AJAX), 90% of server
3. Spaghetti code (~4yr ago), no structure in who calls who
4. Now: 10-60% of interaction on client: data transferred in DOM,
a.k.a lossy transformation, trying to use DOM as a database — sucks
5. Future: client will own entire complexity of application (?)
5
Saturday, February 2, 13
HISTORY, PROBLEMS AND SOLUTIONS
PROBLEMS IN FRONT-END
DEVELOPMENT
‣ Client has more responsibility but not all (bugs)
‣ Complexity grows polynomial, features *2, must keep in mind all
features before,
‣ Leads to re-writes, throwing away all code
‣ Accumulation of technical debt, more resource (developers)
6
DANGER
ZONE!
Saturday, February 2, 13
HISTORY, PROBLEMS AND SOLUTIONS
SOLUTIONS
‣ Better architecture (MVC)
‣ Best practices
‣ More developers (not scalable)
7
RIGHT
CHOICE
Saturday, February 2, 13
HISTORY, PROBLEMS AND SOLUTIONS
WHY USE MVC FOR FRONT-END
DEVELOPMENT?
“Code is not an asset, it’s a liability” - Unknown source
8
Saturday, February 2, 13
HISTORY, PROBLEMS AND SOLUTIONS
MODEL VIEW CONTROLLER
‣ Better code organization leads to faster/cheaper maintenance
‣ Reusability
‣ Separation of components/concerns
9
Saturday, February 2, 13
HISTORY, PROBLEMS AND SOLUTIONS
MODEL VIEW CONTROLLER
‣ Model: data and information
‣ View: visual representation
‣ Controller: interaction between a user and the system
10
Saturday, February 2, 13
WHAT IS BACKBONE.JS?
WHY USE MVC FOR FRONT-END
DEVELOPMENT?
‣ Desktop-like applications in a browser (think GMail)
‣ Thick client and mobile apps
‣ Lots of interactions via HTTP Request (ex-AJAX)
‣ Updating DOM and dealing with callbacks quickly becomes PITA
11
Saturday, February 2, 13
HISTORY, PROBLEMS AND SOLUTIONS
ADVANTAGES OF BACKBONE.JS
‣ Simple: (View, Models, Collections, Router)
‣ Uses Underscore, jQuery/Zepto
‣ Customizable, works well with mobile apps
12
Saturday, February 2, 13
HISTORY, PROBLEMS AND SOLUTIONS
OTHER MVC FRAMEWORKS
‣ Ember.js: live-templates (Handebars), scaffolding, more desktop-like
apps
‣ Knockout.js: lightweight
http://todomvc.com/ — Todo app in various frameworks
13
GOOD
TO
KNOW
Saturday, February 2, 13
BACKBONE.JS COMPONENTS
MAIN COMPONENTS
‣ Router: Controller in MVC concept
‣ Templates and Views: View (and Controller) in MVC concept
‣ Collections and Models: Model in MVC concept
14
Saturday, February 2, 13
BACKBONE.JS COMPONENTS
BEST PRACTICE
‣ Router: defines routes a.k.a nice URLs (/stories/:id/element/:id), calls
views/collections
‣ Views: accept data, bind events, compile and render HTML
‣ Templates: HTML templates with JS instructions (Underscore)
‣ Collections: fetch, parse data via REST API, represent sets of Models
‣ Models: manipulate attributes, fetch and parse data via REST API
15
Saturday, February 2, 13
BACKBONE.JS COMPONENTS
FLEXIBILITY
‣ Router: not required
‣ Templates: can be just variables inside of Views or separate file (AMD)
‣ View can use Models directly
16
Saturday, February 2, 13
BACKBONE.JS COMPONENTS
STANDARD TRANSACTIONS
MADE EASIER WITH A
FRAMEWORK
‣ fetchAll: collection.fetchAll() instead of $.ajax(...) via REST API
‣ save(): model.save() instead of $.ajax(...) via REST API
‣ Updates Views based on data changes
17
Saturday, February 2, 13
Q&A
INTRODUCTION TO BACKBONE.JS 18
Saturday, February 2, 13
KEY OBJECTIVE(S) AGENDA
RESOURCESDELIVERABLE
EXERCISE 1 - “HELLO WORLD”
Build ‘Hello World” Backbone.js
app from scratch
15m 1. Download jQuery, Underscore and Backbone
2. Create HTML and link libraries
3. Create Router
4. Create View
5. Run HTML file
Insert deliverable/outcome http://github.com/azat-co/ga-backbone/
19
Saturday, February 2, 13
IMAGES 20
Saturday, February 2, 13
DISCUSSION
TIME
INTRODUCTION TO BACKBONE.JS 21
Saturday, February 2, 13
EVENT BINDING
BAD PRACTICE
Have lots of ajax calls with callback inside of them:
$.ajax (...
//fetch data
success: function(...
//update view
))
22
DANGER
ZONE!
Saturday, February 2, 13
EVENT BINDING
GOOD PRACTICE
In a view listen to Backbone collection.on(‘change’) event:
collection.fetch() triggers ‘change’ event
23
RIGHT
CHOICE
Saturday, February 2, 13
EVENT BINDING
FURTHER READING
Awesome guide on on going from jQuery to Backbone.js:
https://github.com/kjbekkelund/writings/blob/master/published/
understanding-backbone.md/
or
http://bit.ly/NGqFeK
24
GOOD
TO
KNOW
Saturday, February 2, 13
KEY OBJECTIVE(S) AGENDA
RESOURCESDELIVERABLE
EXERCISE 2 - “EVENT BINDING”
Extend SSBSK to use subviews 15m 1. Download SSBSK
2. Create subview
3. Populate subview with models
4. Render subview
5. Run HTML file
Insert deliverable/outcome http://github.com/azat-co/ga-backbone/
25
Saturday, February 2, 13
DISCUSSION
TIME
INSERT CLASS TITLE 26
Saturday, February 2, 13
REQUIRE.JS AND AMD
ASYNCHRONOUS MODULE
DEFINITION
Require.js allows for asynchronous loading of JS and other files (HTML):
define(["alpha"], function (alpha) {
return {
verb: function(){
return alpha.verb() + 2;
}
};
});
27
GOOD
TO
KNOW
Saturday, February 2, 13
BACKBONE.JS STARTER KIT 28
SUPER SIMPLE BACKBONE
STARTER KIT
Backbone + Twitter Bootstarp + Require.js (AMD) Boilerplate:
https://github.com/azat-co/super-simple-backbone-starter-kit
GOOD
TO
KNOW
Saturday, February 2, 13
KEY OBJECTIVE(S) AGENDA
RESOURCESDELIVERABLE
EXERCISE 3 - SSBSK
Extend SSBSK to use subviews 15m 1. Download SSBSK
2. Create subview
3. Populate subview with models
4. Render subview
5. Run HTML file
Insert deliverable/outcome http://github.com/azat-co/ga-backbone/
29
Saturday, February 2, 13
BOILERPLATE
FURTHER READING
Backbone Boilerplate Buddy:
https://github.com/backbone-boilerplate/grunt-bbb
Backbone.js Applications:
http://addyosmani.github.com/backbone-fundamentals/
30
GOOD
TO
KNOW
Saturday, February 2, 13
DISCUSSION
TIME
INSERT CLASS TITLE 31
Saturday, February 2, 13
Q&A
INSERT CLASS TITLE 32
Saturday, February 2, 13

More Related Content

Viewers also liked

Introduction to Backbone.js
Introduction to Backbone.jsIntroduction to Backbone.js
Introduction to Backbone.js
Roman Kalyakin
 
Introduction to Backbone.js
Introduction to Backbone.jsIntroduction to Backbone.js
Introduction to Backbone.js
Jonathan Weiss
 
Backbone And Marionette : Take Over The World
Backbone And Marionette : Take Over The WorldBackbone And Marionette : Take Over The World
Backbone And Marionette : Take Over The World
harshit040591
 
Beautiful Maintainable ModularJavascript Codebase with RequireJS - HelsinkiJ...
 Beautiful Maintainable ModularJavascript Codebase with RequireJS - HelsinkiJ... Beautiful Maintainable ModularJavascript Codebase with RequireJS - HelsinkiJ...
Beautiful Maintainable ModularJavascript Codebase with RequireJS - HelsinkiJ...
Mikko Ohtamaa
 
Backbone/Marionette recap [2015]
Backbone/Marionette recap [2015]Backbone/Marionette recap [2015]
Backbone/Marionette recap [2015]
Andrii Lundiak
 
Introduction to Marionette Collective
Introduction to Marionette CollectiveIntroduction to Marionette Collective
Introduction to Marionette Collective
Puppet
 
Introduction to Backbone.js & Marionette.js
Introduction to Backbone.js & Marionette.jsIntroduction to Backbone.js & Marionette.js
Introduction to Backbone.js & Marionette.js
Return on Intelligence
 
Marionette talk 2016
Marionette talk 2016Marionette talk 2016
Marionette talk 2016
Kseniya Redunova
 
Client-side MVC with Backbone.js
Client-side MVC with Backbone.js Client-side MVC with Backbone.js
Client-side MVC with Backbone.js
iloveigloo
 
introduction to Marionette.js (jscafe14)
introduction to Marionette.js (jscafe14)introduction to Marionette.js (jscafe14)
introduction to Marionette.js (jscafe14)
Ryuma Tsukano
 
Marionette: the Backbone framework
Marionette: the Backbone frameworkMarionette: the Backbone framework
Marionette: the Backbone framework
frontendne
 
Backbone.js
Backbone.jsBackbone.js
Backbone.js
VO Tho
 
RequireJS
RequireJSRequireJS
Introduction to Backbone.js
Introduction to Backbone.jsIntroduction to Backbone.js
Introduction to Backbone.jsPragnesh Vaghela
 
RequireJS
RequireJSRequireJS
RequireJS
Tim Doherty
 
Module, AMD, RequireJS
Module, AMD, RequireJSModule, AMD, RequireJS
Module, AMD, RequireJS偉格 高
 

Viewers also liked (17)

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
 
Backbone And Marionette : Take Over The World
Backbone And Marionette : Take Over The WorldBackbone And Marionette : Take Over The World
Backbone And Marionette : Take Over The World
 
Beautiful Maintainable ModularJavascript Codebase with RequireJS - HelsinkiJ...
 Beautiful Maintainable ModularJavascript Codebase with RequireJS - HelsinkiJ... Beautiful Maintainable ModularJavascript Codebase with RequireJS - HelsinkiJ...
Beautiful Maintainable ModularJavascript Codebase with RequireJS - HelsinkiJ...
 
MVC & backbone.js
MVC & backbone.jsMVC & backbone.js
MVC & backbone.js
 
Backbone/Marionette recap [2015]
Backbone/Marionette recap [2015]Backbone/Marionette recap [2015]
Backbone/Marionette recap [2015]
 
Introduction to Marionette Collective
Introduction to Marionette CollectiveIntroduction to Marionette Collective
Introduction to Marionette Collective
 
Introduction to Backbone.js & Marionette.js
Introduction to Backbone.js & Marionette.jsIntroduction to Backbone.js & Marionette.js
Introduction to Backbone.js & Marionette.js
 
Marionette talk 2016
Marionette talk 2016Marionette talk 2016
Marionette talk 2016
 
Client-side MVC with Backbone.js
Client-side MVC with Backbone.js Client-side MVC with Backbone.js
Client-side MVC with Backbone.js
 
introduction to Marionette.js (jscafe14)
introduction to Marionette.js (jscafe14)introduction to Marionette.js (jscafe14)
introduction to Marionette.js (jscafe14)
 
Marionette: the Backbone framework
Marionette: the Backbone frameworkMarionette: the Backbone framework
Marionette: the Backbone framework
 
Backbone.js
Backbone.jsBackbone.js
Backbone.js
 
RequireJS
RequireJSRequireJS
RequireJS
 
Introduction to Backbone.js
Introduction to Backbone.jsIntroduction to Backbone.js
Introduction to Backbone.js
 
RequireJS
RequireJSRequireJS
RequireJS
 
Module, AMD, RequireJS
Module, AMD, RequireJSModule, AMD, RequireJS
Module, AMD, RequireJS
 

Similar to Intro to Backbone.js by Azat Mardanov for General Assembly

Mobilism 2013: A story of how we built Responsive BBC News
Mobilism 2013: A story of how we built Responsive BBC NewsMobilism 2013: A story of how we built Responsive BBC News
Mobilism 2013: A story of how we built Responsive BBC News
John Cleveley
 
HTTP colon slash slash: end of the road? @ CakeFest 2013 in San Francisco
HTTP colon slash slash: end of the road? @ CakeFest 2013 in San FranciscoHTTP colon slash slash: end of the road? @ CakeFest 2013 in San Francisco
HTTP colon slash slash: end of the road? @ CakeFest 2013 in San Francisco
Alessandro Nadalin
 
Meteoro de pegasuus! Desenvolvendo aplicações realtime com MeteorJS
Meteoro de pegasuus! Desenvolvendo aplicações realtime com MeteorJSMeteoro de pegasuus! Desenvolvendo aplicações realtime com MeteorJS
Meteoro de pegasuus! Desenvolvendo aplicações realtime com MeteorJS
Julio Antonio Mendonça de Marins
 
Catching-up web technologies - an endless story
Catching-up web technologies - an endless storyCatching-up web technologies - an endless story
Catching-up web technologies - an endless story
Cleber Jorge Amaral
 
Makingweb: Great front end performance starts on the server.
Makingweb: Great front end performance starts on the server.Makingweb: Great front end performance starts on the server.
Makingweb: Great front end performance starts on the server.
Jon Arne Sæterås
 
Ajax for-coldfusion-developers
Ajax for-coldfusion-developersAjax for-coldfusion-developers
Ajax for-coldfusion-developersSudhakar Ganta
 
Angular JS 2_0 BCS CTO_in_Res V3
Angular JS 2_0 BCS CTO_in_Res V3Angular JS 2_0 BCS CTO_in_Res V3
Angular JS 2_0 BCS CTO_in_Res V3
Bruce Pentreath
 
Front End Development for Back End Java Developers - Jfokus 2020
Front End Development for Back End Java Developers - Jfokus 2020Front End Development for Back End Java Developers - Jfokus 2020
Front End Development for Back End Java Developers - Jfokus 2020
Matt Raible
 
(In)Security Implication in the JS Universe
(In)Security Implication in the JS Universe(In)Security Implication in the JS Universe
(In)Security Implication in the JS Universe
Stefano Di Paola
 
Give Responsive Design a Mobile Performance Boost
Give Responsive Design a Mobile Performance BoostGive Responsive Design a Mobile Performance Boost
Give Responsive Design a Mobile Performance Boost
Grgur Grisogono
 
Front-end optimisation & jQuery Internals (Pycon)
Front-end optimisation & jQuery Internals (Pycon)Front-end optimisation & jQuery Internals (Pycon)
Front-end optimisation & jQuery Internals (Pycon)Artur Cistov
 
Building a Startup Stack with AngularJS
Building a Startup Stack with AngularJSBuilding a Startup Stack with AngularJS
Building a Startup Stack with AngularJS
FITC
 
Writing a massive javascript app
Writing a massive javascript appWriting a massive javascript app
Writing a massive javascript app
Justin Park
 
Fast Slim Correct: The History and Evolution of JavaScript.
Fast Slim Correct: The History and Evolution of JavaScript.Fast Slim Correct: The History and Evolution of JavaScript.
Fast Slim Correct: The History and Evolution of JavaScript.
John Dalziel
 
Front End Development for Back End Developers - UberConf 2017
Front End Development for Back End Developers - UberConf 2017Front End Development for Back End Developers - UberConf 2017
Front End Development for Back End Developers - UberConf 2017
Matt Raible
 
Getting Started: Google Glass Apps with GDK
Getting Started: Google Glass Apps with GDKGetting Started: Google Glass Apps with GDK
Getting Started: Google Glass Apps with GDK
Zi Yong Chua
 
Web components api + Vuejs
Web components api + VuejsWeb components api + Vuejs
Web components api + Vuejs
Mikhail Kuznetcov
 
Magnolia & Angular JS - an Approach for Javascript RIAs Delivered by a CMS
Magnolia & Angular JS - an Approach for Javascript RIAs Delivered by a CMSMagnolia & Angular JS - an Approach for Javascript RIAs Delivered by a CMS
Magnolia & Angular JS - an Approach for Javascript RIAs Delivered by a CMS
Magnolia
 
Igalia Focus and Goals 2020 (2019 WebKit Contributors Meeting)
Igalia Focus and Goals 2020 (2019 WebKit Contributors Meeting)Igalia Focus and Goals 2020 (2019 WebKit Contributors Meeting)
Igalia Focus and Goals 2020 (2019 WebKit Contributors Meeting)
Igalia
 
Real time coding with jWebSocket
Real time coding with jWebSocketReal time coding with jWebSocket
Real time coding with jWebSocket
Victor Antonio Barzana
 

Similar to Intro to Backbone.js by Azat Mardanov for General Assembly (20)

Mobilism 2013: A story of how we built Responsive BBC News
Mobilism 2013: A story of how we built Responsive BBC NewsMobilism 2013: A story of how we built Responsive BBC News
Mobilism 2013: A story of how we built Responsive BBC News
 
HTTP colon slash slash: end of the road? @ CakeFest 2013 in San Francisco
HTTP colon slash slash: end of the road? @ CakeFest 2013 in San FranciscoHTTP colon slash slash: end of the road? @ CakeFest 2013 in San Francisco
HTTP colon slash slash: end of the road? @ CakeFest 2013 in San Francisco
 
Meteoro de pegasuus! Desenvolvendo aplicações realtime com MeteorJS
Meteoro de pegasuus! Desenvolvendo aplicações realtime com MeteorJSMeteoro de pegasuus! Desenvolvendo aplicações realtime com MeteorJS
Meteoro de pegasuus! Desenvolvendo aplicações realtime com MeteorJS
 
Catching-up web technologies - an endless story
Catching-up web technologies - an endless storyCatching-up web technologies - an endless story
Catching-up web technologies - an endless story
 
Makingweb: Great front end performance starts on the server.
Makingweb: Great front end performance starts on the server.Makingweb: Great front end performance starts on the server.
Makingweb: Great front end performance starts on the server.
 
Ajax for-coldfusion-developers
Ajax for-coldfusion-developersAjax for-coldfusion-developers
Ajax for-coldfusion-developers
 
Angular JS 2_0 BCS CTO_in_Res V3
Angular JS 2_0 BCS CTO_in_Res V3Angular JS 2_0 BCS CTO_in_Res V3
Angular JS 2_0 BCS CTO_in_Res V3
 
Front End Development for Back End Java Developers - Jfokus 2020
Front End Development for Back End Java Developers - Jfokus 2020Front End Development for Back End Java Developers - Jfokus 2020
Front End Development for Back End Java Developers - Jfokus 2020
 
(In)Security Implication in the JS Universe
(In)Security Implication in the JS Universe(In)Security Implication in the JS Universe
(In)Security Implication in the JS Universe
 
Give Responsive Design a Mobile Performance Boost
Give Responsive Design a Mobile Performance BoostGive Responsive Design a Mobile Performance Boost
Give Responsive Design a Mobile Performance Boost
 
Front-end optimisation & jQuery Internals (Pycon)
Front-end optimisation & jQuery Internals (Pycon)Front-end optimisation & jQuery Internals (Pycon)
Front-end optimisation & jQuery Internals (Pycon)
 
Building a Startup Stack with AngularJS
Building a Startup Stack with AngularJSBuilding a Startup Stack with AngularJS
Building a Startup Stack with AngularJS
 
Writing a massive javascript app
Writing a massive javascript appWriting a massive javascript app
Writing a massive javascript app
 
Fast Slim Correct: The History and Evolution of JavaScript.
Fast Slim Correct: The History and Evolution of JavaScript.Fast Slim Correct: The History and Evolution of JavaScript.
Fast Slim Correct: The History and Evolution of JavaScript.
 
Front End Development for Back End Developers - UberConf 2017
Front End Development for Back End Developers - UberConf 2017Front End Development for Back End Developers - UberConf 2017
Front End Development for Back End Developers - UberConf 2017
 
Getting Started: Google Glass Apps with GDK
Getting Started: Google Glass Apps with GDKGetting Started: Google Glass Apps with GDK
Getting Started: Google Glass Apps with GDK
 
Web components api + Vuejs
Web components api + VuejsWeb components api + Vuejs
Web components api + Vuejs
 
Magnolia & Angular JS - an Approach for Javascript RIAs Delivered by a CMS
Magnolia & Angular JS - an Approach for Javascript RIAs Delivered by a CMSMagnolia & Angular JS - an Approach for Javascript RIAs Delivered by a CMS
Magnolia & Angular JS - an Approach for Javascript RIAs Delivered by a CMS
 
Igalia Focus and Goals 2020 (2019 WebKit Contributors Meeting)
Igalia Focus and Goals 2020 (2019 WebKit Contributors Meeting)Igalia Focus and Goals 2020 (2019 WebKit Contributors Meeting)
Igalia Focus and Goals 2020 (2019 WebKit Contributors Meeting)
 
Real time coding with jWebSocket
Real time coding with jWebSocketReal time coding with jWebSocket
Real time coding with jWebSocket
 

Recently uploaded

Removing Uninteresting Bytes in Software Fuzzing
Removing Uninteresting Bytes in Software FuzzingRemoving Uninteresting Bytes in Software Fuzzing
Removing Uninteresting Bytes in Software Fuzzing
Aftab Hussain
 
DevOps and Testing slides at DASA Connect
DevOps and Testing slides at DASA ConnectDevOps and Testing slides at DASA Connect
DevOps and Testing slides at DASA Connect
Kari Kakkonen
 
Free Complete Python - A step towards Data Science
Free Complete Python - A step towards Data ScienceFree Complete Python - A step towards Data Science
Free Complete Python - A step towards Data Science
RinaMondal9
 
RESUME BUILDER APPLICATION Project for students
RESUME BUILDER APPLICATION Project for studentsRESUME BUILDER APPLICATION Project for students
RESUME BUILDER APPLICATION Project for students
KAMESHS29
 
Why You Should Replace Windows 11 with Nitrux Linux 3.5.0 for enhanced perfor...
Why You Should Replace Windows 11 with Nitrux Linux 3.5.0 for enhanced perfor...Why You Should Replace Windows 11 with Nitrux Linux 3.5.0 for enhanced perfor...
Why You Should Replace Windows 11 with Nitrux Linux 3.5.0 for enhanced perfor...
SOFTTECHHUB
 
GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...
GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...
GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...
Sri Ambati
 
SAP Sapphire 2024 - ASUG301 building better apps with SAP Fiori.pdf
SAP Sapphire 2024 - ASUG301 building better apps with SAP Fiori.pdfSAP Sapphire 2024 - ASUG301 building better apps with SAP Fiori.pdf
SAP Sapphire 2024 - ASUG301 building better apps with SAP Fiori.pdf
Peter Spielvogel
 
Quantum Computing: Current Landscape and the Future Role of APIs
Quantum Computing: Current Landscape and the Future Role of APIsQuantum Computing: Current Landscape and the Future Role of APIs
Quantum Computing: Current Landscape and the Future Role of APIs
Vlad Stirbu
 
Encryption in Microsoft 365 - ExpertsLive Netherlands 2024
Encryption in Microsoft 365 - ExpertsLive Netherlands 2024Encryption in Microsoft 365 - ExpertsLive Netherlands 2024
Encryption in Microsoft 365 - ExpertsLive Netherlands 2024
Albert Hoitingh
 
UiPath Test Automation using UiPath Test Suite series, part 4
UiPath Test Automation using UiPath Test Suite series, part 4UiPath Test Automation using UiPath Test Suite series, part 4
UiPath Test Automation using UiPath Test Suite series, part 4
DianaGray10
 
The Art of the Pitch: WordPress Relationships and Sales
The Art of the Pitch: WordPress Relationships and SalesThe Art of the Pitch: WordPress Relationships and Sales
The Art of the Pitch: WordPress Relationships and Sales
Laura Byrne
 
FIDO Alliance Osaka Seminar: FIDO Security Aspects.pdf
FIDO Alliance Osaka Seminar: FIDO Security Aspects.pdfFIDO Alliance Osaka Seminar: FIDO Security Aspects.pdf
FIDO Alliance Osaka Seminar: FIDO Security Aspects.pdf
FIDO Alliance
 
FIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdf
FIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdfFIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdf
FIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdf
FIDO Alliance
 
Smart TV Buyer Insights Survey 2024 by 91mobiles.pdf
Smart TV Buyer Insights Survey 2024 by 91mobiles.pdfSmart TV Buyer Insights Survey 2024 by 91mobiles.pdf
Smart TV Buyer Insights Survey 2024 by 91mobiles.pdf
91mobiles
 
PCI PIN Basics Webinar from the Controlcase Team
PCI PIN Basics Webinar from the Controlcase TeamPCI PIN Basics Webinar from the Controlcase Team
PCI PIN Basics Webinar from the Controlcase Team
ControlCase
 
Alt. GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using ...
Alt. GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using ...Alt. GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using ...
Alt. GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using ...
James Anderson
 
Secstrike : Reverse Engineering & Pwnable tools for CTF.pptx
Secstrike : Reverse Engineering & Pwnable tools for CTF.pptxSecstrike : Reverse Engineering & Pwnable tools for CTF.pptx
Secstrike : Reverse Engineering & Pwnable tools for CTF.pptx
nkrafacyberclub
 
Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...
Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...
Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...
UiPathCommunity
 
Video Streaming: Then, Now, and in the Future
Video Streaming: Then, Now, and in the FutureVideo Streaming: Then, Now, and in the Future
Video Streaming: Then, Now, and in the Future
Alpen-Adria-Universität
 
Securing your Kubernetes cluster_ a step-by-step guide to success !
Securing your Kubernetes cluster_ a step-by-step guide to success !Securing your Kubernetes cluster_ a step-by-step guide to success !
Securing your Kubernetes cluster_ a step-by-step guide to success !
KatiaHIMEUR1
 

Recently uploaded (20)

Removing Uninteresting Bytes in Software Fuzzing
Removing Uninteresting Bytes in Software FuzzingRemoving Uninteresting Bytes in Software Fuzzing
Removing Uninteresting Bytes in Software Fuzzing
 
DevOps and Testing slides at DASA Connect
DevOps and Testing slides at DASA ConnectDevOps and Testing slides at DASA Connect
DevOps and Testing slides at DASA Connect
 
Free Complete Python - A step towards Data Science
Free Complete Python - A step towards Data ScienceFree Complete Python - A step towards Data Science
Free Complete Python - A step towards Data Science
 
RESUME BUILDER APPLICATION Project for students
RESUME BUILDER APPLICATION Project for studentsRESUME BUILDER APPLICATION Project for students
RESUME BUILDER APPLICATION Project for students
 
Why You Should Replace Windows 11 with Nitrux Linux 3.5.0 for enhanced perfor...
Why You Should Replace Windows 11 with Nitrux Linux 3.5.0 for enhanced perfor...Why You Should Replace Windows 11 with Nitrux Linux 3.5.0 for enhanced perfor...
Why You Should Replace Windows 11 with Nitrux Linux 3.5.0 for enhanced perfor...
 
GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...
GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...
GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...
 
SAP Sapphire 2024 - ASUG301 building better apps with SAP Fiori.pdf
SAP Sapphire 2024 - ASUG301 building better apps with SAP Fiori.pdfSAP Sapphire 2024 - ASUG301 building better apps with SAP Fiori.pdf
SAP Sapphire 2024 - ASUG301 building better apps with SAP Fiori.pdf
 
Quantum Computing: Current Landscape and the Future Role of APIs
Quantum Computing: Current Landscape and the Future Role of APIsQuantum Computing: Current Landscape and the Future Role of APIs
Quantum Computing: Current Landscape and the Future Role of APIs
 
Encryption in Microsoft 365 - ExpertsLive Netherlands 2024
Encryption in Microsoft 365 - ExpertsLive Netherlands 2024Encryption in Microsoft 365 - ExpertsLive Netherlands 2024
Encryption in Microsoft 365 - ExpertsLive Netherlands 2024
 
UiPath Test Automation using UiPath Test Suite series, part 4
UiPath Test Automation using UiPath Test Suite series, part 4UiPath Test Automation using UiPath Test Suite series, part 4
UiPath Test Automation using UiPath Test Suite series, part 4
 
The Art of the Pitch: WordPress Relationships and Sales
The Art of the Pitch: WordPress Relationships and SalesThe Art of the Pitch: WordPress Relationships and Sales
The Art of the Pitch: WordPress Relationships and Sales
 
FIDO Alliance Osaka Seminar: FIDO Security Aspects.pdf
FIDO Alliance Osaka Seminar: FIDO Security Aspects.pdfFIDO Alliance Osaka Seminar: FIDO Security Aspects.pdf
FIDO Alliance Osaka Seminar: FIDO Security Aspects.pdf
 
FIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdf
FIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdfFIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdf
FIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdf
 
Smart TV Buyer Insights Survey 2024 by 91mobiles.pdf
Smart TV Buyer Insights Survey 2024 by 91mobiles.pdfSmart TV Buyer Insights Survey 2024 by 91mobiles.pdf
Smart TV Buyer Insights Survey 2024 by 91mobiles.pdf
 
PCI PIN Basics Webinar from the Controlcase Team
PCI PIN Basics Webinar from the Controlcase TeamPCI PIN Basics Webinar from the Controlcase Team
PCI PIN Basics Webinar from the Controlcase Team
 
Alt. GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using ...
Alt. GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using ...Alt. GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using ...
Alt. GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using ...
 
Secstrike : Reverse Engineering & Pwnable tools for CTF.pptx
Secstrike : Reverse Engineering & Pwnable tools for CTF.pptxSecstrike : Reverse Engineering & Pwnable tools for CTF.pptx
Secstrike : Reverse Engineering & Pwnable tools for CTF.pptx
 
Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...
Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...
Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...
 
Video Streaming: Then, Now, and in the Future
Video Streaming: Then, Now, and in the FutureVideo Streaming: Then, Now, and in the Future
Video Streaming: Then, Now, and in the Future
 
Securing your Kubernetes cluster_ a step-by-step guide to success !
Securing your Kubernetes cluster_ a step-by-step guide to success !Securing your Kubernetes cluster_ a step-by-step guide to success !
Securing your Kubernetes cluster_ a step-by-step guide to success !
 

Intro to Backbone.js by Azat Mardanov for General Assembly

  • 1. Azat Mardanov Engineer, Storify.com INTRODUCTION TO BACKBONE.JS Saturday, February 2, 13
  • 2. AGENDA ‣ History, Problems and Solutions ‣ Brief Overview of Backbone Components ‣ Building Backbone App From Scratch ‣ Backbone Starter Kit ‣ Subviews ‣ AMD 2 Saturday, February 2, 13
  • 3. INTRODUCTION ‣ Over 12 years in software development ‣ Author of RapidPrototypingWithJS.com ‣ 500 Startups grad (Gizmo) AZAT MARDANOV ENGINEER, STORIFY 3 @azat_co azat.co Saturday, February 2, 13
  • 5. HISTORY, PROBLEMS AND SOLUTIONS HISTORY 1. Before: Pure HTML from the server, client just a painting instructions 2. Some client code to style (DHTML, AJAX), 90% of server 3. Spaghetti code (~4yr ago), no structure in who calls who 4. Now: 10-60% of interaction on client: data transferred in DOM, a.k.a lossy transformation, trying to use DOM as a database — sucks 5. Future: client will own entire complexity of application (?) 5 Saturday, February 2, 13
  • 6. HISTORY, PROBLEMS AND SOLUTIONS PROBLEMS IN FRONT-END DEVELOPMENT ‣ Client has more responsibility but not all (bugs) ‣ Complexity grows polynomial, features *2, must keep in mind all features before, ‣ Leads to re-writes, throwing away all code ‣ Accumulation of technical debt, more resource (developers) 6 DANGER ZONE! Saturday, February 2, 13
  • 7. HISTORY, PROBLEMS AND SOLUTIONS SOLUTIONS ‣ Better architecture (MVC) ‣ Best practices ‣ More developers (not scalable) 7 RIGHT CHOICE Saturday, February 2, 13
  • 8. HISTORY, PROBLEMS AND SOLUTIONS WHY USE MVC FOR FRONT-END DEVELOPMENT? “Code is not an asset, it’s a liability” - Unknown source 8 Saturday, February 2, 13
  • 9. HISTORY, PROBLEMS AND SOLUTIONS MODEL VIEW CONTROLLER ‣ Better code organization leads to faster/cheaper maintenance ‣ Reusability ‣ Separation of components/concerns 9 Saturday, February 2, 13
  • 10. HISTORY, PROBLEMS AND SOLUTIONS MODEL VIEW CONTROLLER ‣ Model: data and information ‣ View: visual representation ‣ Controller: interaction between a user and the system 10 Saturday, February 2, 13
  • 11. WHAT IS BACKBONE.JS? WHY USE MVC FOR FRONT-END DEVELOPMENT? ‣ Desktop-like applications in a browser (think GMail) ‣ Thick client and mobile apps ‣ Lots of interactions via HTTP Request (ex-AJAX) ‣ Updating DOM and dealing with callbacks quickly becomes PITA 11 Saturday, February 2, 13
  • 12. HISTORY, PROBLEMS AND SOLUTIONS ADVANTAGES OF BACKBONE.JS ‣ Simple: (View, Models, Collections, Router) ‣ Uses Underscore, jQuery/Zepto ‣ Customizable, works well with mobile apps 12 Saturday, February 2, 13
  • 13. HISTORY, PROBLEMS AND SOLUTIONS OTHER MVC FRAMEWORKS ‣ Ember.js: live-templates (Handebars), scaffolding, more desktop-like apps ‣ Knockout.js: lightweight http://todomvc.com/ — Todo app in various frameworks 13 GOOD TO KNOW Saturday, February 2, 13
  • 14. BACKBONE.JS COMPONENTS MAIN COMPONENTS ‣ Router: Controller in MVC concept ‣ Templates and Views: View (and Controller) in MVC concept ‣ Collections and Models: Model in MVC concept 14 Saturday, February 2, 13
  • 15. BACKBONE.JS COMPONENTS BEST PRACTICE ‣ Router: defines routes a.k.a nice URLs (/stories/:id/element/:id), calls views/collections ‣ Views: accept data, bind events, compile and render HTML ‣ Templates: HTML templates with JS instructions (Underscore) ‣ Collections: fetch, parse data via REST API, represent sets of Models ‣ Models: manipulate attributes, fetch and parse data via REST API 15 Saturday, February 2, 13
  • 16. BACKBONE.JS COMPONENTS FLEXIBILITY ‣ Router: not required ‣ Templates: can be just variables inside of Views or separate file (AMD) ‣ View can use Models directly 16 Saturday, February 2, 13
  • 17. BACKBONE.JS COMPONENTS STANDARD TRANSACTIONS MADE EASIER WITH A FRAMEWORK ‣ fetchAll: collection.fetchAll() instead of $.ajax(...) via REST API ‣ save(): model.save() instead of $.ajax(...) via REST API ‣ Updates Views based on data changes 17 Saturday, February 2, 13
  • 18. Q&A INTRODUCTION TO BACKBONE.JS 18 Saturday, February 2, 13
  • 19. KEY OBJECTIVE(S) AGENDA RESOURCESDELIVERABLE EXERCISE 1 - “HELLO WORLD” Build ‘Hello World” Backbone.js app from scratch 15m 1. Download jQuery, Underscore and Backbone 2. Create HTML and link libraries 3. Create Router 4. Create View 5. Run HTML file Insert deliverable/outcome http://github.com/azat-co/ga-backbone/ 19 Saturday, February 2, 13
  • 21. DISCUSSION TIME INTRODUCTION TO BACKBONE.JS 21 Saturday, February 2, 13
  • 22. EVENT BINDING BAD PRACTICE Have lots of ajax calls with callback inside of them: $.ajax (... //fetch data success: function(... //update view )) 22 DANGER ZONE! Saturday, February 2, 13
  • 23. EVENT BINDING GOOD PRACTICE In a view listen to Backbone collection.on(‘change’) event: collection.fetch() triggers ‘change’ event 23 RIGHT CHOICE Saturday, February 2, 13
  • 24. EVENT BINDING FURTHER READING Awesome guide on on going from jQuery to Backbone.js: https://github.com/kjbekkelund/writings/blob/master/published/ understanding-backbone.md/ or http://bit.ly/NGqFeK 24 GOOD TO KNOW Saturday, February 2, 13
  • 25. KEY OBJECTIVE(S) AGENDA RESOURCESDELIVERABLE EXERCISE 2 - “EVENT BINDING” Extend SSBSK to use subviews 15m 1. Download SSBSK 2. Create subview 3. Populate subview with models 4. Render subview 5. Run HTML file Insert deliverable/outcome http://github.com/azat-co/ga-backbone/ 25 Saturday, February 2, 13
  • 26. DISCUSSION TIME INSERT CLASS TITLE 26 Saturday, February 2, 13
  • 27. REQUIRE.JS AND AMD ASYNCHRONOUS MODULE DEFINITION Require.js allows for asynchronous loading of JS and other files (HTML): define(["alpha"], function (alpha) { return { verb: function(){ return alpha.verb() + 2; } }; }); 27 GOOD TO KNOW Saturday, February 2, 13
  • 28. BACKBONE.JS STARTER KIT 28 SUPER SIMPLE BACKBONE STARTER KIT Backbone + Twitter Bootstarp + Require.js (AMD) Boilerplate: https://github.com/azat-co/super-simple-backbone-starter-kit GOOD TO KNOW Saturday, February 2, 13
  • 29. KEY OBJECTIVE(S) AGENDA RESOURCESDELIVERABLE EXERCISE 3 - SSBSK Extend SSBSK to use subviews 15m 1. Download SSBSK 2. Create subview 3. Populate subview with models 4. Render subview 5. Run HTML file Insert deliverable/outcome http://github.com/azat-co/ga-backbone/ 29 Saturday, February 2, 13
  • 30. BOILERPLATE FURTHER READING Backbone Boilerplate Buddy: https://github.com/backbone-boilerplate/grunt-bbb Backbone.js Applications: http://addyosmani.github.com/backbone-fundamentals/ 30 GOOD TO KNOW Saturday, February 2, 13
  • 31. DISCUSSION TIME INSERT CLASS TITLE 31 Saturday, February 2, 13
  • 32. Q&A INSERT CLASS TITLE 32 Saturday, February 2, 13