SlideShare uma empresa Scribd logo
1 de 23
Enterprise JavaScript Development: Oxymoron?
 Part 2 of 2




                            Jeremy Likness (@JeremyLikness)
                            Principal Consultant
                            jlikness@wintellect.com
                                                                Copyright © 2012




consulting   training   design   debugging                    wintellect.com
Agenda
 •   JSLint / JSHint – personal style is for fashion, not code
 •   jQuery – one API to bind them all
 •   JSON and Web API – flexible information on demand
 •   Twitter Bootstrap – one layout to rule them all
 •   Underscore.js – the Swiss army knife of JavaScript
 •   Backbone.js – MVC on the client
 •   RequireJS – dependency resolution
 •   MVVM (for example, Kendo UI) – “Gotta keep „em separated”
 •   Amplify.js – publisher/subscriber for the client
 •   … and many more great projects we won‟t have time to discuss today




consulting   training   design   debugging                    wintellect.com
JSLint / JSHint
 • JSLint – JavaScript code that checks for problems in JavaScript code
 • Authored by Douglas Crockford, who helped develop the JavaScript
   language, pioneered JSON and wrote The Good Parts
 • Very restrictive – many debates over whether it is the right tool or not
 • JSHint – code quality tool, open source project
      – Fork of JSLint
      – More flexible
      – Help avoid typos and language “gotchas”
 • Available as a Visual Studio extension
      – Install from Tools -> Extensions and Updates
      – Configure – you can even error builds based on the results
      – Start early because existing code can be a bear to fix




consulting    training   design     debugging                        wintellect.com
demo
   JSLint and JSHint




consulting   training   design   debugging   wintellect.com
jQuery
 • Very “recent” API – released in 2006
 • Most popular JavaScript library in use
 • Designed to make it easier to perform client-side scripting without
   worrying about browser-specific idioms
 • Bundled with the Visual Studio 2012 MVC templates
 • Support for current Firefox, Safari, Opera, and Chrome versions, and
   Internet Explorer 6 and above
 • Support for plug-ins
      – jQuery UI
      – jQuery grid
      – jQuery mobile




consulting   training   design   debugging                     wintellect.com
demo
   jQuery




consulting   training   design   debugging   wintellect.com
JSON and Web API
 •   JSON is client-side data “for free”
 •   JSON is very human readable
 •   JSON is more compact than XML
 •   JSON is a popular format for REST
 •   Web API makes it extremely easy to stand up REST end points
 •   Web API provides true “negotiation” of content types
 •   Web API gives control over response codes
 •   Very easy syntax with jQuery




consulting   training   design   debugging                    wintellect.com
demo
   JSON and Web API




consulting   training   design   debugging   wintellect.com
Twitter Bootstrap
 •   Fixed and fluid layouts
 •   Browser compatibility
 •   Tablet and smartphone support (responsive CSS)
 •   Provides tons of CSS for existing components:
      –   Forms
      –   Labels
      –   Alert boxes
      –   Typographical sections
 • Also includes JavaScript extensions for various features
      – Alert, Tooltip, Modal, etc.
 • Great way to baseline your application
 • Completely customizable CSS




consulting    training    design      debugging               wintellect.com
demo
   Twitter Bootstrap




consulting   training   design   debugging   wintellect.com
Underscore.js
 • Swiss Army Knife
 • Lots of great collection-based functions
      –   Each
      –   Find
      –   Filter
      –   Map
      –   Reduce
      –   Pluck
 • Testers
      – Is Empty?
      – Has?
      – Etc.
 • Templates
 • Helpers i.e. bind = no more self-invoking function


consulting    training   design   debugging             wintellect.com
demo
   Underscore.js




consulting   training   design   debugging   wintellect.com
Backbone.js
 • MVC on the client (C = Collection, not Controller!)
 • Models
      –   Constructors
      –   Defaults
      –   Change notification
      –   Initialization
 • Collections
      – Auto-binding to REST end points
      – Change notification
 • Views
      – Bind to tags
      – Support for templates
 • Events
 • Navigation / Browser journal
 • Great for “data over forms” style applications

consulting     training   design   debugging             wintellect.com
demo
   Backbone.js




consulting   training   design   debugging   wintellect.com
Require.js
 •   Script file / module loader
 •   In-browser dynamic assembly of components
 •   Designed to improve speed and quality
 •   Load modules only if/when/as needed
 •   Optimizer tool can compress JavaScript into single file
 •   In each file, you use this to load other scripts that are dependencies:
     require(["app/services"], function(services) { ...




consulting   training   design   debugging                         wintellect.com
demo
   Require.js




consulting   training   design   debugging   wintellect.com
MVVM (Kendo UI)
 • Telerik
 • Knockout.js equivalent “open source” version
 • ObservableObject
      –   Bind for event handlers
      –   Get/Set for property updates with change notification
      –   toJSON for clean transport
      –   Exposes a change event
 • ObservableArray
      – Array with change tracking
      – Most basic array functions supported
 • Model – specialized ObservableObject with data definition for data
   sources
 • Validator – works with existing HTML5 tags and allows for custom
   rules


consulting    training    design     debugging                    wintellect.com
demo
   Kendo UI / MVVM




consulting   training   design   debugging   wintellect.com
Amplify.js (Postal.js)
 • JavaScript implementation of publish/subscribe pattern
 • Synchronous and asynchronous
 • No external dependencies
 • Channels for further scoping
 • Envelopes for correlation, tracking, etc.
 • Use events on objects and subscribe within modules
 • Use publisher/subscriber for decoupled communication
   between/across modules
 • Use the adapter pattern to adapt pub/sub to events
 • Wiretap to log all events




consulting   training   design   debugging                  wintellect.com
demo
   Amplify.js




consulting   training   design   debugging   wintellect.com
Recap
 •   JavaScript is good
 •   JavaScript has bad parts
 •   JavaScript can get ugly
 •   Known the language
 •   Program with JavaScript, not "C# using JavaScript"
 •   Learn how to make your code:
      –   Use the good parts (JSHint/JSLint)
      –   Cross-browser friendly (jQuery)
      –   Fluid and adaptable (Twitter Bootstrap)
      –   Data-friendly (JSON)
      –   Consistent (tools like underscore)
      –   Modular (Backbone, Requires)
      –   Testable and Extendable (MVVM)
      –   Decoupled (Postal)



consulting     training   design     debugging            wintellect.com
Links and Recommendations

 • Twitter me:
   @JeremyLikness
 • Blog me:
   http://csharperimage.jeremylikness.com/
 • JavaScript: The Good Parts
   ISBN: 0596517742




consulting   training   design   debugging   wintellect.com
Questions?




                            Jeremy Likness (@JeremyLikness)
                            Principal Consultant
                            jlikness@wintellect.com



consulting   training   design   debugging                    wintellect.com

Mais conteúdo relacionado

Mais procurados

Javascript library toolbox
Javascript library toolboxJavascript library toolbox
Javascript library toolbox
Skysoul Pty.Ltd.
 
UI Standards Presentation 2
UI Standards Presentation 2UI Standards Presentation 2
UI Standards Presentation 2
Joshua Jeffryes
 
WebNetConf 2012 - Single Page Apps
WebNetConf 2012 - Single Page AppsWebNetConf 2012 - Single Page Apps
WebNetConf 2012 - Single Page Apps
Pop Apps
 
Building rich interface components with SharePoint
Building rich interface components with SharePointBuilding rich interface components with SharePoint
Building rich interface components with SharePoint
Louis-Philippe Lavoie
 
SPA, Scalable Application & AngularJS
SPA, Scalable Application & AngularJSSPA, Scalable Application & AngularJS
SPA, Scalable Application & AngularJS
Mitch Chen
 

Mais procurados (20)

Javascript library toolbox
Javascript library toolboxJavascript library toolbox
Javascript library toolbox
 
UI Standards Presentation 2
UI Standards Presentation 2UI Standards Presentation 2
UI Standards Presentation 2
 
WebNetConf 2012 - Single Page Apps
WebNetConf 2012 - Single Page AppsWebNetConf 2012 - Single Page Apps
WebNetConf 2012 - Single Page Apps
 
Life ray training
Life ray training Life ray training
Life ray training
 
Concrete5 workshop
Concrete5 workshopConcrete5 workshop
Concrete5 workshop
 
concrete5 from developer perspective
concrete5 from developer perspectiveconcrete5 from developer perspective
concrete5 from developer perspective
 
IWMW 2002: Web standards briefing (session C2)
IWMW 2002: Web standards briefing (session C2)IWMW 2002: Web standards briefing (session C2)
IWMW 2002: Web standards briefing (session C2)
 
Standardization in W3C
Standardization in W3CStandardization in W3C
Standardization in W3C
 
Building rich interface components with SharePoint
Building rich interface components with SharePointBuilding rich interface components with SharePoint
Building rich interface components with SharePoint
 
HTML5 and CSS3: does now really mean now?
HTML5 and CSS3: does now really mean now?HTML5 and CSS3: does now really mean now?
HTML5 and CSS3: does now really mean now?
 
Practical html5
Practical html5Practical html5
Practical html5
 
SPA, Scalable Application & AngularJS
SPA, Scalable Application & AngularJSSPA, Scalable Application & AngularJS
SPA, Scalable Application & AngularJS
 
Web Development
Web DevelopmentWeb Development
Web Development
 
Wheel.js
Wheel.jsWheel.js
Wheel.js
 
Spa with angular
Spa with angularSpa with angular
Spa with angular
 
Front end developer responsibilities what does a front-end developer do?
Front end developer responsibilities  what does a front-end developer do?Front end developer responsibilities  what does a front-end developer do?
Front end developer responsibilities what does a front-end developer do?
 
Html5 with SharePoint 2010
Html5 with SharePoint 2010Html5 with SharePoint 2010
Html5 with SharePoint 2010
 
Do you need jQuery in 2019?
Do you need jQuery in 2019?Do you need jQuery in 2019?
Do you need jQuery in 2019?
 
December 4 SDForum Java Sig Presentation
December 4 SDForum Java Sig PresentationDecember 4 SDForum Java Sig Presentation
December 4 SDForum Java Sig Presentation
 
JVx with VisionX and Oracle Forms integration
JVx with VisionX and Oracle Forms integrationJVx with VisionX and Oracle Forms integration
JVx with VisionX and Oracle Forms integration
 

Destaque (6)

I server duress system design
 I server duress system design I server duress system design
I server duress system design
 
Programação de Bezerros - palcos
Programação de Bezerros - palcosProgramação de Bezerros - palcos
Programação de Bezerros - palcos
 
Jay Angoff: "King v. Burwell: Obamacare on the Brink?" 6.16.15
Jay Angoff: "King v. Burwell: Obamacare on the Brink?" 6.16.15Jay Angoff: "King v. Burwell: Obamacare on the Brink?" 6.16.15
Jay Angoff: "King v. Burwell: Obamacare on the Brink?" 6.16.15
 
Surviving Financial Distress1
Surviving Financial Distress1Surviving Financial Distress1
Surviving Financial Distress1
 
Linda Greenhouse: "King v. Burwell: Obamacare on the Brink?" 6.16.15
Linda Greenhouse: "King v. Burwell: Obamacare on the Brink?" 6.16.15Linda Greenhouse: "King v. Burwell: Obamacare on the Brink?" 6.16.15
Linda Greenhouse: "King v. Burwell: Obamacare on the Brink?" 6.16.15
 
Safe cities & gender issues 14 7-2015
Safe cities & gender issues  14 7-2015Safe cities & gender issues  14 7-2015
Safe cities & gender issues 14 7-2015
 

Semelhante a Wintellect - Devscovery - Enterprise JavaScript Development 2 of 2

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
Ganesh Kondal
 
Intro to modern web technology
Intro to modern web technologyIntro to modern web technology
Intro to modern web technology
Chris Love
 
Ramarao_US_NewNumber_Promatrix_Webservice
Ramarao_US_NewNumber_Promatrix_WebserviceRamarao_US_NewNumber_Promatrix_Webservice
Ramarao_US_NewNumber_Promatrix_Webservice
Ramarao Behara
 
Ramarao_US_NewNumber_Promatrix_Webservice
Ramarao_US_NewNumber_Promatrix_WebserviceRamarao_US_NewNumber_Promatrix_Webservice
Ramarao_US_NewNumber_Promatrix_Webservice
Ramarao Behara
 

Semelhante a Wintellect - Devscovery - Enterprise JavaScript Development 2 of 2 (20)

Silverlight 5
Silverlight 5Silverlight 5
Silverlight 5
 
Sai Sharan_UI_Resume
Sai Sharan_UI_ResumeSai Sharan_UI_Resume
Sai Sharan_UI_Resume
 
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 
 
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
 
Training presentation.pptx
Training presentation.pptxTraining presentation.pptx
Training presentation.pptx
 
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
 
Intro to modern web technology
Intro to modern web technologyIntro to modern web technology
Intro to modern web technology
 
Santosh_Resume_Java
Santosh_Resume_JavaSantosh_Resume_Java
Santosh_Resume_Java
 
A Smooth Transition to HTML5 Using MVVM
A Smooth Transition to HTML5 Using MVVMA Smooth Transition to HTML5 Using MVVM
A Smooth Transition to HTML5 Using MVVM
 
Building SPA’s (Single Page App) with Backbone.js
Building SPA’s (Single Page App) with Backbone.jsBuilding SPA’s (Single Page App) with Backbone.js
Building SPA’s (Single Page App) with Backbone.js
 
Wintellect - Windows 8 for the Silverlight and WPF Developer
Wintellect   - Windows 8 for the Silverlight and WPF DeveloperWintellect   - Windows 8 for the Silverlight and WPF Developer
Wintellect - Windows 8 for the Silverlight and WPF Developer
 
Angular JS, A dive to concepts
Angular JS, A dive to conceptsAngular JS, A dive to concepts
Angular JS, A dive to concepts
 
Chalam_JAVA_Portal
Chalam_JAVA_PortalChalam_JAVA_Portal
Chalam_JAVA_Portal
 
Ramarao_US_NewNumber_Promatrix_Webservice
Ramarao_US_NewNumber_Promatrix_WebserviceRamarao_US_NewNumber_Promatrix_Webservice
Ramarao_US_NewNumber_Promatrix_Webservice
 
Ramarao_US_NewNumber_Promatrix_Webservice
Ramarao_US_NewNumber_Promatrix_WebserviceRamarao_US_NewNumber_Promatrix_Webservice
Ramarao_US_NewNumber_Promatrix_Webservice
 
Seven Versions of One Web Application
Seven Versions of One Web ApplicationSeven Versions of One Web Application
Seven Versions of One Web Application
 
Putting together a web app
Putting together a web appPutting together a web app
Putting together a web app
 
Meetup. Technologies Intro for Non-Tech People
Meetup. Technologies Intro for Non-Tech PeopleMeetup. Technologies Intro for Non-Tech People
Meetup. Technologies Intro for Non-Tech People
 
KhajavaliShaik
KhajavaliShaikKhajavaliShaik
KhajavaliShaik
 
A guide to hiring a great developer to build your first app (redacted version)
A guide to hiring a great developer to build your first app (redacted version)A guide to hiring a great developer to build your first app (redacted version)
A guide to hiring a great developer to build your first app (redacted version)
 

Último

Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Safe Software
 

Último (20)

HTML Injection Attacks: Impact and Mitigation Strategies
HTML Injection Attacks: Impact and Mitigation StrategiesHTML Injection Attacks: Impact and Mitigation Strategies
HTML Injection Attacks: Impact and Mitigation Strategies
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt Robison
 
Top 10 Most Downloaded Games on Play Store in 2024
Top 10 Most Downloaded Games on Play Store in 2024Top 10 Most Downloaded Games on Play Store in 2024
Top 10 Most Downloaded Games on Play Store in 2024
 
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
 
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
 
Real Time Object Detection Using Open CV
Real Time Object Detection Using Open CVReal Time Object Detection Using Open CV
Real Time Object Detection Using Open CV
 
Deploy with confidence: VMware Cloud Foundation 5.1 on next gen Dell PowerEdg...
Deploy with confidence: VMware Cloud Foundation 5.1 on next gen Dell PowerEdg...Deploy with confidence: VMware Cloud Foundation 5.1 on next gen Dell PowerEdg...
Deploy with confidence: VMware Cloud Foundation 5.1 on next gen Dell PowerEdg...
 
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a Fresher
 
Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...
 
A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?
 
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
 
GenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdfGenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdf
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
 
Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processors
 

Wintellect - Devscovery - Enterprise JavaScript Development 2 of 2

  • 1. Enterprise JavaScript Development: Oxymoron? Part 2 of 2 Jeremy Likness (@JeremyLikness) Principal Consultant jlikness@wintellect.com Copyright © 2012 consulting training design debugging wintellect.com
  • 2. Agenda • JSLint / JSHint – personal style is for fashion, not code • jQuery – one API to bind them all • JSON and Web API – flexible information on demand • Twitter Bootstrap – one layout to rule them all • Underscore.js – the Swiss army knife of JavaScript • Backbone.js – MVC on the client • RequireJS – dependency resolution • MVVM (for example, Kendo UI) – “Gotta keep „em separated” • Amplify.js – publisher/subscriber for the client • … and many more great projects we won‟t have time to discuss today consulting training design debugging wintellect.com
  • 3. JSLint / JSHint • JSLint – JavaScript code that checks for problems in JavaScript code • Authored by Douglas Crockford, who helped develop the JavaScript language, pioneered JSON and wrote The Good Parts • Very restrictive – many debates over whether it is the right tool or not • JSHint – code quality tool, open source project – Fork of JSLint – More flexible – Help avoid typos and language “gotchas” • Available as a Visual Studio extension – Install from Tools -> Extensions and Updates – Configure – you can even error builds based on the results – Start early because existing code can be a bear to fix consulting training design debugging wintellect.com
  • 4. demo JSLint and JSHint consulting training design debugging wintellect.com
  • 5. jQuery • Very “recent” API – released in 2006 • Most popular JavaScript library in use • Designed to make it easier to perform client-side scripting without worrying about browser-specific idioms • Bundled with the Visual Studio 2012 MVC templates • Support for current Firefox, Safari, Opera, and Chrome versions, and Internet Explorer 6 and above • Support for plug-ins – jQuery UI – jQuery grid – jQuery mobile consulting training design debugging wintellect.com
  • 6. demo jQuery consulting training design debugging wintellect.com
  • 7. JSON and Web API • JSON is client-side data “for free” • JSON is very human readable • JSON is more compact than XML • JSON is a popular format for REST • Web API makes it extremely easy to stand up REST end points • Web API provides true “negotiation” of content types • Web API gives control over response codes • Very easy syntax with jQuery consulting training design debugging wintellect.com
  • 8. demo JSON and Web API consulting training design debugging wintellect.com
  • 9. Twitter Bootstrap • Fixed and fluid layouts • Browser compatibility • Tablet and smartphone support (responsive CSS) • Provides tons of CSS for existing components: – Forms – Labels – Alert boxes – Typographical sections • Also includes JavaScript extensions for various features – Alert, Tooltip, Modal, etc. • Great way to baseline your application • Completely customizable CSS consulting training design debugging wintellect.com
  • 10. demo Twitter Bootstrap consulting training design debugging wintellect.com
  • 11. Underscore.js • Swiss Army Knife • Lots of great collection-based functions – Each – Find – Filter – Map – Reduce – Pluck • Testers – Is Empty? – Has? – Etc. • Templates • Helpers i.e. bind = no more self-invoking function consulting training design debugging wintellect.com
  • 12. demo Underscore.js consulting training design debugging wintellect.com
  • 13. Backbone.js • MVC on the client (C = Collection, not Controller!) • Models – Constructors – Defaults – Change notification – Initialization • Collections – Auto-binding to REST end points – Change notification • Views – Bind to tags – Support for templates • Events • Navigation / Browser journal • Great for “data over forms” style applications consulting training design debugging wintellect.com
  • 14. demo Backbone.js consulting training design debugging wintellect.com
  • 15. Require.js • Script file / module loader • In-browser dynamic assembly of components • Designed to improve speed and quality • Load modules only if/when/as needed • Optimizer tool can compress JavaScript into single file • In each file, you use this to load other scripts that are dependencies: require(["app/services"], function(services) { ... consulting training design debugging wintellect.com
  • 16. demo Require.js consulting training design debugging wintellect.com
  • 17. MVVM (Kendo UI) • Telerik • Knockout.js equivalent “open source” version • ObservableObject – Bind for event handlers – Get/Set for property updates with change notification – toJSON for clean transport – Exposes a change event • ObservableArray – Array with change tracking – Most basic array functions supported • Model – specialized ObservableObject with data definition for data sources • Validator – works with existing HTML5 tags and allows for custom rules consulting training design debugging wintellect.com
  • 18. demo Kendo UI / MVVM consulting training design debugging wintellect.com
  • 19. Amplify.js (Postal.js) • JavaScript implementation of publish/subscribe pattern • Synchronous and asynchronous • No external dependencies • Channels for further scoping • Envelopes for correlation, tracking, etc. • Use events on objects and subscribe within modules • Use publisher/subscriber for decoupled communication between/across modules • Use the adapter pattern to adapt pub/sub to events • Wiretap to log all events consulting training design debugging wintellect.com
  • 20. demo Amplify.js consulting training design debugging wintellect.com
  • 21. Recap • JavaScript is good • JavaScript has bad parts • JavaScript can get ugly • Known the language • Program with JavaScript, not "C# using JavaScript" • Learn how to make your code: – Use the good parts (JSHint/JSLint) – Cross-browser friendly (jQuery) – Fluid and adaptable (Twitter Bootstrap) – Data-friendly (JSON) – Consistent (tools like underscore) – Modular (Backbone, Requires) – Testable and Extendable (MVVM) – Decoupled (Postal) consulting training design debugging wintellect.com
  • 22. Links and Recommendations • Twitter me: @JeremyLikness • Blog me: http://csharperimage.jeremylikness.com/ • JavaScript: The Good Parts ISBN: 0596517742 consulting training design debugging wintellect.com
  • 23. Questions? Jeremy Likness (@JeremyLikness) Principal Consultant jlikness@wintellect.com consulting training design debugging wintellect.com

Notas do Editor

  1. Show the original first. Run in IE8 and IE9, then show crash in IE7 – find out if students can even see where the crash is coming from.Run JSLint, note it stops after a short time and you have to keep making fixes to keep it moving. Note complaints about spaces. Show that the defect was addressed.Now configure JSHint and show that experience.
  2. Run in browser, then show IETester and run in IE 6.0Show the form, then the logic, then the view – note how this helps structure the code and make it more readable
  3. Show fetch in ChromeShow fetch in IEShow fiddler testing
  4. Show fetch in ChromeShow fetch in IEShow fiddler testing
  5. Show fetch in ChromeShow fetch in IEShow fiddler testing
  6. Show fetch in ChromeShow fetch in IEShow fiddler testing
  7. Show fetch in ChromeShow fetch in IEShow fiddler testing
  8. Show fetch in ChromeShow fetch in IEShow fiddler testing
  9. Show fetch in ChromeShow fetch in IEShow fiddler testing