SlideShare a Scribd company logo
1 of 24
Large-Scale Web Development
with JavaScript
Navid Ahmadi
Ph.D. in Computer Science
October 30, 2013
MVC
Data Model
View
– Template

Controller
View Model
Binder (Observer)
Router
REST
JSON
Web Software Architectures
DB

DB

Controllers, Routers,
Model, UI Templates

Data management
Authentication

Server
Client

User Input,
Events

Data

Generated UI

Model, View,
Controllers, User input
and Event Handling

UI Styling, Validation

•
•
•
•

Rails, .NET MVC,…
Thin client
More Secure
Web Pages

•
•
•
•

Backbone, Angular, …
Thick client
Rich and Responsive
Web applications

Data
JS challenges
JS apps get cluttered quickly
– Missing organization
– Over 2K lines are hard to manage
– No support for modules, packages, namespaces

Dynamic language

1. MVC

2. TypeScript

– No static type checking, No Refactoring tools
– Variable scopes are not clear
– Software fails at runtime

Build and deploy
– Minification and obfuscation should be done explicitly
– Hard to create builds based on configurations

3. AMD
Client-side MVC in JavaScript
View
(HTML Template)

Loads into DOM

Controller

Sends user actions
Updates the DOM

Creates the Binder

Updates the Model
(triggered by the user
or the system)

Binder
(observer)
Sends Updates
Data Model

Client

(observable)

Server

Routes

Rest of the
Software
JS-based MVC Libraries

http://todomvc.com/
Backbone.js
http://backbonejs.org/
Used in Groupon Now!, Hulu, Delicious, Khan Academy,
Foursquare,…

Main concepts
–
–
–
–

Model
Collection
View
Router
Backbone Model*

* Available at http://backbonetutorials.com/
Extending a Model
Observing the changes in the Model

Observable
Binding the Model to the REST API

POST /user : Server returns the ‘id’
Retrieving Model’s data from the Server
GET /user/1
Update/Delete from the Server

PUT /user/1

DELETE /user/1
Backbone Collection
Backbone View
Connecting the View to the Model*

* http://stackoverflow.com/questions/5651629/backbone-js-collections-and-views/5656433#5656433
Backbone Router
Backbone Pros and Cons
Pros
–
–
–
–

Tied to Underscore.js
Lightweight (6K V1.1.0)
Very flexible
Works offline
• Using LocalStorage
• Optimistic since V0.9

Cons
– Verbose (e.g., GPL vs DSL)
– REST-oriented
Asynchronous Module Definition
AMD
–
–
–
–

http://requirejs.org/
Allows creating packages, modules, and dependencies
Automatically backed by a minifier (Closure compiler, Uglify)
Cons: Does not allow circular dependencies

has.js
– https://github.com/phiggins42/has.js/
– Feature detection
– build configuration
• Dead code removal by Closure Compiler
TypeScript
Superset of JavaScript
– Compiler (.ts => .js)
– Open-source

Language features:
–
–
–
–

Static Type Checking
Interfaces
Classical Inheritance
Generics

http://www.typescriptlang.org

Microsoft Visual Studio Plugin
– Intellisense
– Refactoring (e.g., variable renaming)
Other MV* solutions
Angular: MVW
– Complete development framework
– Two-way binding of View and Model
– Increases development speed
• 5K lines backbone app reported to become 750 lines

– Opinionated

Knockout
– KO.Observable()

Explore www.todomvc.com
Other goodies
Git, Github, Bitbucket
Responsive Design
– Bootstrap

Glyph Icons, FontAwesome
NoSQL Databases
– MongoDB

Server-side JS
– Node.js

CSS frameworks
– LESS, Blueprint,…

Real-time apps
– Meteor, Derby, Firebase, Pusher

Continuous Integration, Test-driven design
– Buster, Jasmine, TestSwarm
Conclusions
Build large-scale Web applications with
– MVC (Code Organization, Separation of Concerns)
– AMD (Code Organization, Easy Deployment)
– TypeScript (Static Type Checking)

JS dev has been revolutionized in the last 5 years
– Stay updated with the newest technologies
– Consider integrating new tools into your projects
– Consider migrating your existing projects!
About Me

http://www.linkedin.com/in/nahmadi
navid.ai@gmail.com

ASP.NET developer in 2002-2005
When C# was still in beta!
Got into JavaScript development in 2006
2007-08: Created a Game Engine and Compiler
– JS + Canvas
Agent
– 4K LOC
Gallery

Agent
Gallery

Depiction
Editor

2009-11: Created an Online Game Design Environment
Depiction
– Front-end: JS + Dojo; Backend: Drupal + Nginx
Editor
– 15+K LOC

UX design for novice users
– Game level editor
– Visual Programming Language

Conditions

Programming Environment

Actions

More Related Content

What's hot

MVC Pattern. Flex implementation of MVC
MVC Pattern. Flex implementation of MVCMVC Pattern. Flex implementation of MVC
MVC Pattern. Flex implementation of MVCAnton Krasnoshchok
 
Vertical Slices in .NET - Bojan Veljanovski, March 2016, MK.NET UG
Vertical Slices in .NET - Bojan Veljanovski, March 2016, MK.NET UGVertical Slices in .NET - Bojan Veljanovski, March 2016, MK.NET UG
Vertical Slices in .NET - Bojan Veljanovski, March 2016, MK.NET UGBojan Veljanovski
 
Evaluation and prototyping of an HTML5 Client for iOS devices
Evaluation and prototyping of an HTML5 Client for iOS devicesEvaluation and prototyping of an HTML5 Client for iOS devices
Evaluation and prototyping of an HTML5 Client for iOS devicesMario Gonzalez
 
JAVA EE training from 3rd-oct-2015
JAVA EE training from 3rd-oct-2015JAVA EE training from 3rd-oct-2015
JAVA EE training from 3rd-oct-2015Naz Ish
 
Introduction to ASP.NET MVC 1.0
Introduction to ASP.NET MVC 1.0Introduction to ASP.NET MVC 1.0
Introduction to ASP.NET MVC 1.0Shiju Varghese
 
iOS Architectures
iOS ArchitecturesiOS Architectures
iOS ArchitecturesHung Hoang
 
Berlin.JAR: Web future without web frameworks
Berlin.JAR: Web future without web frameworksBerlin.JAR: Web future without web frameworks
Berlin.JAR: Web future without web frameworksStephan Schmidt
 

What's hot (20)

Introduction to Ember.js
Introduction to Ember.jsIntroduction to Ember.js
Introduction to Ember.js
 
Mar 16 report
Mar 16 reportMar 16 report
Mar 16 report
 
React js Introduction
React js IntroductionReact js Introduction
React js Introduction
 
WPF Meets Applications
WPF Meets ApplicationsWPF Meets Applications
WPF Meets Applications
 
MVC Pattern. Flex implementation of MVC
MVC Pattern. Flex implementation of MVCMVC Pattern. Flex implementation of MVC
MVC Pattern. Flex implementation of MVC
 
Top 10 web application development frameworks 2016
Top 10 web application development frameworks 2016Top 10 web application development frameworks 2016
Top 10 web application development frameworks 2016
 
Angular js gtg-27feb2013
Angular js gtg-27feb2013Angular js gtg-27feb2013
Angular js gtg-27feb2013
 
Mvc fundamental
Mvc fundamentalMvc fundamental
Mvc fundamental
 
Vertical Slices in .NET - Bojan Veljanovski, March 2016, MK.NET UG
Vertical Slices in .NET - Bojan Veljanovski, March 2016, MK.NET UGVertical Slices in .NET - Bojan Veljanovski, March 2016, MK.NET UG
Vertical Slices in .NET - Bojan Veljanovski, March 2016, MK.NET UG
 
Evaluation and prototyping of an HTML5 Client for iOS devices
Evaluation and prototyping of an HTML5 Client for iOS devicesEvaluation and prototyping of an HTML5 Client for iOS devices
Evaluation and prototyping of an HTML5 Client for iOS devices
 
Ranjith_Reddy Yallampalli Resume
Ranjith_Reddy Yallampalli ResumeRanjith_Reddy Yallampalli Resume
Ranjith_Reddy Yallampalli Resume
 
Cv kapil
Cv kapilCv kapil
Cv kapil
 
JavaCro'15 - Web UI best practice integration with Java EE 7 - Peter Lehto
JavaCro'15 - Web UI best practice integration with Java EE 7 - Peter LehtoJavaCro'15 - Web UI best practice integration with Java EE 7 - Peter Lehto
JavaCro'15 - Web UI best practice integration with Java EE 7 - Peter Lehto
 
JAVA EE training from 3rd-oct-2015
JAVA EE training from 3rd-oct-2015JAVA EE training from 3rd-oct-2015
JAVA EE training from 3rd-oct-2015
 
Introduction to ASP.NET MVC 1.0
Introduction to ASP.NET MVC 1.0Introduction to ASP.NET MVC 1.0
Introduction to ASP.NET MVC 1.0
 
Santosh_Resume_Java
Santosh_Resume_JavaSantosh_Resume_Java
Santosh_Resume_Java
 
JavaME UI - JMDF 2007
JavaME UI - JMDF 2007JavaME UI - JMDF 2007
JavaME UI - JMDF 2007
 
iOS Architectures
iOS ArchitecturesiOS Architectures
iOS Architectures
 
Cqrs intro
Cqrs introCqrs intro
Cqrs intro
 
Berlin.JAR: Web future without web frameworks
Berlin.JAR: Web future without web frameworksBerlin.JAR: Web future without web frameworks
Berlin.JAR: Web future without web frameworks
 

Similar to Large-Scale Web Development with JavaScript

Introduction to Visual studio 2012
Introduction to Visual studio 2012 Introduction to Visual studio 2012
Introduction to Visual studio 2012 Prashant Chaudhary
 
Wintellect - Devscovery - Enterprise JavaScript Development 2 of 2
Wintellect - Devscovery - Enterprise JavaScript Development 2 of 2Wintellect - Devscovery - Enterprise JavaScript Development 2 of 2
Wintellect - Devscovery - Enterprise JavaScript Development 2 of 2Jeremy Likness
 
Seven Versions of One Web Application
Seven Versions of One Web ApplicationSeven Versions of One Web Application
Seven Versions of One Web ApplicationYakov Fain
 
Mobile and IBM Worklight Best Practices
Mobile and IBM Worklight Best PracticesMobile and IBM Worklight Best Practices
Mobile and IBM Worklight Best PracticesAndrew Ferrier
 
Javascript library toolbox
Javascript library toolboxJavascript library toolbox
Javascript library toolboxSkysoul Pty.Ltd.
 
Tech io spa_angularjs_20130814_v0.9.5
Tech io spa_angularjs_20130814_v0.9.5Tech io spa_angularjs_20130814_v0.9.5
Tech io spa_angularjs_20130814_v0.9.5Ganesh Kondal
 
A164 enterprise javascript ibm node sdk
A164 enterprise javascript ibm node sdkA164 enterprise javascript ibm node sdk
A164 enterprise javascript ibm node sdkToby Corbin
 
AngularJS - Architecture decisions in a large project 
AngularJS - Architecture decisionsin a large project AngularJS - Architecture decisionsin a large project 
AngularJS - Architecture decisions in a large project Elad Hirsch
 
What's new in Portal and WCM 8.5
What's new in Portal and WCM 8.5What's new in Portal and WCM 8.5
What's new in Portal and WCM 8.5Vinayak Tavargeri
 
Social Photos - My presentation at Microsoft Tech Day
Social Photos - My presentation at Microsoft Tech DaySocial Photos - My presentation at Microsoft Tech Day
Social Photos - My presentation at Microsoft Tech DayTechMaster Vietnam
 
Introduction to web application development with Vue (for absolute beginners)...
Introduction to web application development with Vue (for absolute beginners)...Introduction to web application development with Vue (for absolute beginners)...
Introduction to web application development with Vue (for absolute beginners)...Lucas Jellema
 
Software Development Practices.pdf
Software Development Practices.pdfSoftware Development Practices.pdf
Software Development Practices.pdfEzhumalai p
 
Valentine with Angular js - Introduction
Valentine with Angular js - IntroductionValentine with Angular js - Introduction
Valentine with Angular js - IntroductionSenthil Kumar
 
Going offline with JS (DDD Sydney)
Going offline with JS (DDD Sydney)Going offline with JS (DDD Sydney)
Going offline with JS (DDD Sydney)brendankowitz
 
JDD2015: Java Everywhere Again—with DukeScript - Jaroslav Tulach
JDD2015: Java Everywhere Again—with DukeScript - Jaroslav TulachJDD2015: Java Everywhere Again—with DukeScript - Jaroslav Tulach
JDD2015: Java Everywhere Again—with DukeScript - Jaroslav TulachPROIDEA
 
MV* presentation frameworks in Javascript: en garde, pret, allez!
MV* presentation frameworks in Javascript: en garde, pret, allez!MV* presentation frameworks in Javascript: en garde, pret, allez!
MV* presentation frameworks in Javascript: en garde, pret, allez!Roberto Messora
 

Similar to Large-Scale Web Development with JavaScript (20)

Introduction to Visual studio 2012
Introduction to Visual studio 2012 Introduction to Visual studio 2012
Introduction to Visual studio 2012
 
Wintellect - Devscovery - Enterprise JavaScript Development 2 of 2
Wintellect - Devscovery - Enterprise JavaScript Development 2 of 2Wintellect - Devscovery - Enterprise JavaScript Development 2 of 2
Wintellect - Devscovery - Enterprise JavaScript Development 2 of 2
 
Seven Versions of One Web Application
Seven Versions of One Web ApplicationSeven Versions of One Web Application
Seven Versions of One Web Application
 
Mobile and IBM Worklight Best Practices
Mobile and IBM Worklight Best PracticesMobile and IBM Worklight Best Practices
Mobile and IBM Worklight Best Practices
 
Javascript library toolbox
Javascript library toolboxJavascript library toolbox
Javascript library toolbox
 
Tech io spa_angularjs_20130814_v0.9.5
Tech io spa_angularjs_20130814_v0.9.5Tech io spa_angularjs_20130814_v0.9.5
Tech io spa_angularjs_20130814_v0.9.5
 
A164 enterprise javascript ibm node sdk
A164 enterprise javascript ibm node sdkA164 enterprise javascript ibm node sdk
A164 enterprise javascript ibm node sdk
 
AngularJS - Architecture decisions in a large project 
AngularJS - Architecture decisionsin a large project AngularJS - Architecture decisionsin a large project 
AngularJS - Architecture decisions in a large project 
 
What's new in Portal and WCM 8.5
What's new in Portal and WCM 8.5What's new in Portal and WCM 8.5
What's new in Portal and WCM 8.5
 
Social Photos - My presentation at Microsoft Tech Day
Social Photos - My presentation at Microsoft Tech DaySocial Photos - My presentation at Microsoft Tech Day
Social Photos - My presentation at Microsoft Tech Day
 
Introduction to web application development with Vue (for absolute beginners)...
Introduction to web application development with Vue (for absolute beginners)...Introduction to web application development with Vue (for absolute beginners)...
Introduction to web application development with Vue (for absolute beginners)...
 
Gwt Deep Dive
Gwt Deep DiveGwt Deep Dive
Gwt Deep Dive
 
Software Development Practices.pdf
Software Development Practices.pdfSoftware Development Practices.pdf
Software Development Practices.pdf
 
Valentine with Angular js - Introduction
Valentine with Angular js - IntroductionValentine with Angular js - Introduction
Valentine with Angular js - Introduction
 
Going offline with JS (DDD Sydney)
Going offline with JS (DDD Sydney)Going offline with JS (DDD Sydney)
Going offline with JS (DDD Sydney)
 
JDD2015: Java Everywhere Again—with DukeScript - Jaroslav Tulach
JDD2015: Java Everywhere Again—with DukeScript - Jaroslav TulachJDD2015: Java Everywhere Again—with DukeScript - Jaroslav Tulach
JDD2015: Java Everywhere Again—with DukeScript - Jaroslav Tulach
 
Lecture 05 web_applicationframeworks
Lecture 05 web_applicationframeworksLecture 05 web_applicationframeworks
Lecture 05 web_applicationframeworks
 
MV* presentation frameworks in Javascript: en garde, pret, allez!
MV* presentation frameworks in Javascript: en garde, pret, allez!MV* presentation frameworks in Javascript: en garde, pret, allez!
MV* presentation frameworks in Javascript: en garde, pret, allez!
 
Ci selenium
Ci seleniumCi selenium
Ci selenium
 
Google App Engine overview (GAE/J)
Google App Engine overview (GAE/J)Google App Engine overview (GAE/J)
Google App Engine overview (GAE/J)
 

Recently uploaded

Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Commit University
 
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)Bun (KitWorks Team Study 노별마루 발표 2024.4.22)
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)Wonjun Hwang
 
"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr BaganFwdays
 
Install Stable Diffusion in windows machine
Install Stable Diffusion in windows machineInstall Stable Diffusion in windows machine
Install Stable Diffusion in windows machinePadma Pradeep
 
Dev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebDev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebUiPathCommunity
 
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024BookNet Canada
 
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Mark Simos
 
Human Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsHuman Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsMark Billinghurst
 
Powerpoint exploring the locations used in television show Time Clash
Powerpoint exploring the locations used in television show Time ClashPowerpoint exploring the locations used in television show Time Clash
Powerpoint exploring the locations used in television show Time Clashcharlottematthew16
 
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticsKotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticscarlostorres15106
 
Streamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupStreamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupFlorian Wilhelm
 
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
"Federated learning: out of reach no matter how close",Oleksandr LapshynFwdays
 
Connect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationConnect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationSlibray Presentation
 
Developer Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLDeveloper Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLScyllaDB
 
SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024Scott Keck-Warren
 
Unleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubUnleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubKalema Edgar
 
Commit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easyCommit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easyAlfredo García Lavilla
 
Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Scott Keck-Warren
 
Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 3652toLead Limited
 
Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Enterprise Knowledge
 

Recently uploaded (20)

Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!
 
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)Bun (KitWorks Team Study 노별마루 발표 2024.4.22)
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)
 
"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan
 
Install Stable Diffusion in windows machine
Install Stable Diffusion in windows machineInstall Stable Diffusion in windows machine
Install Stable Diffusion in windows machine
 
Dev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebDev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio Web
 
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
 
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
 
Human Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsHuman Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR Systems
 
Powerpoint exploring the locations used in television show Time Clash
Powerpoint exploring the locations used in television show Time ClashPowerpoint exploring the locations used in television show Time Clash
Powerpoint exploring the locations used in television show Time Clash
 
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticsKotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
 
Streamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupStreamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project Setup
 
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
 
Connect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationConnect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck Presentation
 
Developer Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLDeveloper Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQL
 
SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024
 
Unleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubUnleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding Club
 
Commit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easyCommit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easy
 
Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024
 
Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365
 
Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024
 

Large-Scale Web Development with JavaScript

  • 1. Large-Scale Web Development with JavaScript Navid Ahmadi Ph.D. in Computer Science October 30, 2013
  • 2. MVC Data Model View – Template Controller View Model Binder (Observer) Router REST JSON
  • 3. Web Software Architectures DB DB Controllers, Routers, Model, UI Templates Data management Authentication Server Client User Input, Events Data Generated UI Model, View, Controllers, User input and Event Handling UI Styling, Validation • • • • Rails, .NET MVC,… Thin client More Secure Web Pages • • • • Backbone, Angular, … Thick client Rich and Responsive Web applications Data
  • 4. JS challenges JS apps get cluttered quickly – Missing organization – Over 2K lines are hard to manage – No support for modules, packages, namespaces Dynamic language 1. MVC 2. TypeScript – No static type checking, No Refactoring tools – Variable scopes are not clear – Software fails at runtime Build and deploy – Minification and obfuscation should be done explicitly – Hard to create builds based on configurations 3. AMD
  • 5. Client-side MVC in JavaScript View (HTML Template) Loads into DOM Controller Sends user actions Updates the DOM Creates the Binder Updates the Model (triggered by the user or the system) Binder (observer) Sends Updates Data Model Client (observable) Server Routes Rest of the Software
  • 7. Backbone.js http://backbonejs.org/ Used in Groupon Now!, Hulu, Delicious, Khan Academy, Foursquare,… Main concepts – – – – Model Collection View Router
  • 8. Backbone Model* * Available at http://backbonetutorials.com/
  • 10. Observing the changes in the Model Observable
  • 11. Binding the Model to the REST API POST /user : Server returns the ‘id’
  • 12. Retrieving Model’s data from the Server GET /user/1
  • 13. Update/Delete from the Server PUT /user/1 DELETE /user/1
  • 16. Connecting the View to the Model* * http://stackoverflow.com/questions/5651629/backbone-js-collections-and-views/5656433#5656433
  • 18. Backbone Pros and Cons Pros – – – – Tied to Underscore.js Lightweight (6K V1.1.0) Very flexible Works offline • Using LocalStorage • Optimistic since V0.9 Cons – Verbose (e.g., GPL vs DSL) – REST-oriented
  • 19. Asynchronous Module Definition AMD – – – – http://requirejs.org/ Allows creating packages, modules, and dependencies Automatically backed by a minifier (Closure compiler, Uglify) Cons: Does not allow circular dependencies has.js – https://github.com/phiggins42/has.js/ – Feature detection – build configuration • Dead code removal by Closure Compiler
  • 20. TypeScript Superset of JavaScript – Compiler (.ts => .js) – Open-source Language features: – – – – Static Type Checking Interfaces Classical Inheritance Generics http://www.typescriptlang.org Microsoft Visual Studio Plugin – Intellisense – Refactoring (e.g., variable renaming)
  • 21. Other MV* solutions Angular: MVW – Complete development framework – Two-way binding of View and Model – Increases development speed • 5K lines backbone app reported to become 750 lines – Opinionated Knockout – KO.Observable() Explore www.todomvc.com
  • 22. Other goodies Git, Github, Bitbucket Responsive Design – Bootstrap Glyph Icons, FontAwesome NoSQL Databases – MongoDB Server-side JS – Node.js CSS frameworks – LESS, Blueprint,… Real-time apps – Meteor, Derby, Firebase, Pusher Continuous Integration, Test-driven design – Buster, Jasmine, TestSwarm
  • 23. Conclusions Build large-scale Web applications with – MVC (Code Organization, Separation of Concerns) – AMD (Code Organization, Easy Deployment) – TypeScript (Static Type Checking) JS dev has been revolutionized in the last 5 years – Stay updated with the newest technologies – Consider integrating new tools into your projects – Consider migrating your existing projects!
  • 24. About Me http://www.linkedin.com/in/nahmadi navid.ai@gmail.com ASP.NET developer in 2002-2005 When C# was still in beta! Got into JavaScript development in 2006 2007-08: Created a Game Engine and Compiler – JS + Canvas Agent – 4K LOC Gallery Agent Gallery Depiction Editor 2009-11: Created an Online Game Design Environment Depiction – Front-end: JS + Dojo; Backend: Drupal + Nginx Editor – 15+K LOC UX design for novice users – Game level editor – Visual Programming Language Conditions Programming Environment Actions

Editor's Notes

  1. Left is older and has been around for a long timeRight is newer approach and more interesting as the Web is not about the page anymore but about the applications
  2. 1- They help organize the application 2- Convention over Configuration (of Rails)