Js Development: An Important Aspect of Web 2.0
Js Development: An Important Aspect of Web 2.0
INTRODUCTION
JS in Web 2.0
JS Concepts
JS Development
Object-Oriented JavaScript
Documenting JavaScript
Writing High-Quality JavaScript
Boosting JavaScript Performance
JS Design Patterns
Design
Design
Design
Design
Patterns:
Patterns:
Patterns:
Patterns:
Creational
Structural
Behavioral
Architectural
Summary
JS CONCEPTS:
OBJECT-ORIENTED JAVASCRIPT
Composition
Variable(s) & function(s)
Properties & Methods
Purpose
Group together related
Concepts
Functionality
Simplify code
http://www.w3schools.com/js/js_objects.asp
JS CONCEPTS:
DOCUMENTING JAVASCRIPT
// example of basic inline comments
Benefits Developers
Primary
Collaborator(s)
API users
Special Formatting
YUIDoc
/*
The block comment is appropriate when there are going to
be multiple lines of text in a comment.
/*
/**
*YUIDoc only recognizes block *comments following this
format
*/
@class ClassTag
npm g install yuidocjs
^installs YUIDoc globally using node.js
JS CONCEPTS:
Closure
Closure
Closure
Closure
Compiler
Linter
Library
Templates
Unit Testing
Manually
Using Frameworks
Qunit
Mocha
Jasmine
JS CONCEPTS:
Delaying JS Loading
Access
Size
Reduce Variables
Delay JS Loading
Avoid With
Debug code
http://www.w3schools.com/js/js_performance.asp
JS DESIGN PATTERNS:
CREATIONAL
Factory
Abstract Factory
Builder
Prototype
Singleton
For JS in particular
Name spacing
Declaring dependencies
Module
Sandbox
http://www.dofactory.com/javascript/designpatterns
JS DESIGN PATTERNS:
STRUCTURAL
Adapter
Bridge
Composite
Decorator
Faade
Flyweight
Proxy
http://www.dofactory.com/javascript/designpatterns
JS DESIGN PATTERNS:
BEHAVIORAL
Chain of Responsibility
Command
Interpreter
Iterator
Mediator
Memento
Observer
State
Strategy
Template Method
Visitor
http://www.dofactory.com/javascript/designpatterns
JS DESIGN PATTERNS:
ARCHITECTURAL
JS DEVELOPMENT:
RequireJS
BDLoad
Cajon
CurlJS
LoaderJS
UMD
Yabble
jQuery
Module Name Aliases
JS DEVELOPMENT:
Battery Life
Network Speeds & Latency
On-Board Memory Size
OS Responsiveness
Device Sensors
Geolocation
Touch
Orientation and Direction
Motion
Missing
Camera
Microphone
JS DEVELOPMENT:
JS DEVELOPMENT:
Chat Client
Web Server
Personally Hosted
Hosted Online
JS DEVELOPMENT:
Templating
Without a Library
With Mustache.js
With Handlebars.js
With Embedded JS (EJS)
With Underscore.js
JS DEVELOPMENT:
JS DEVELOPMENT:
CHROME/Opera
Ctrl+Shift+I
Safari
PreferencesAdvancedShow Develop
Firefox
Ctrl+Shift+C
Firebug
https://getfirebug.com
ToolsWeb DeveloperFirebugShow Firebug
Almost Universally
Right-click and Inspect Element
SUMMARY
JS is an important aspect of Web 2.0
JS dominates modern coding, especially on the web
JS Design Patterns are helpful
Node.js isnt for everyone
It is a good Time to be a Developer
REFERENCES
(n.d.) (n.a.) Java Design Patterns. Retrieved 18 FEB 2016 from
http://www.allapplabs.com/java_design_patterns/singleton_pattern.htm
Odell, Den (2014). Pro JavaScript Development: Coding, Capabilities, and Tooling.
Apress.