SlideShare a Scribd company logo
1 of 19
Download to read offline
JavaScript + OOP
Dustin Tauer :: Easel Solution




                    @dtauer
Dustin Tauer

Developer (11 years)
 Instructor (7 years)

 Web :: Mobile ::
   eLearning




                        @dtauer
Easel Solutions
   Training
    • Design, Web, Mobile,
      eLearning, Strategy,
      Social, etc.
   Customized Training
   Consulting
   Adobe Connect




                             @dtauer
Topics
   OOP Techniques
    • Scope
    • Classes
    • Public/Private
    • Inheritance
   A bit of framework talk
    • RequireJS, BackboneJS, etc




                         @dtauer
Who’s down with OOP?
Classes, Inheritance, Interfaces, etc.




                      @dtauer
Flash History
1997                2006               2012
Flash               Flash              Flash
Player              Player             Player
  2                   9*                11.4



         2003                 2008
         Flash                Flash
         Player               Player
           5                    10

                         @dtauer
.Net History

2002          2006               2012
v1.0          v3.0               v4.5



       2005               2010
       v2.0               v4.0


                @dtauer
JavaScript History

  1996
JavaScript                Is that it?



             2005
             AJAX


                @dtauer
Languages need to evolve to
survive
JavaScript has survived because of
frameworks




                    @dtauer
JavaScript is like cement
Foundation for frameworks build on




                    @dtauer
JavaScript is Object Oriented
Polymorphism, encapsulation, and
inheritance are all possible.




                   @dtauer
Most OOP languages have
keywords
class, extends, implements, override, public,
private, protected, final




                     @dtauer
jQuery Plugin (Class)
(function($){
          $.yourPluginName = function(el, radius, options){
                    var base = this;
                    base.$el = $(el);
                    base.el = el;
                    base.$el.data("yourPluginName", base);
                    base.init = function(){
                                 if( typeof( radius ) === "undefined" || radius === null ) radius =
"20px";
                                   base.radius = radius;
                                   base.options = $.extend({},$.yourPluginName.defaultOptions,
options);
                    };
                    base.init();
            };
            $.yourPluginName.defaultOptions = {
                    radius: "20px"
            };
            $.fn.yourPluginName = function(radius, options){
                    return this.each(function(){
                                 (new $.yourPluginName(this, radius, options));
                    });
            };                                  @dtauer
Why are they doing it that
way?
Less stuff in memory (scope)




                    @dtauer
Demo
No frameworks :: Just JavaScript




                    @dtauer
Please, use a framework
   There are far too many to list
    • TodoMVC is a good resource
    • http://todomvc.com/


   RequireJS is manditory
    • Manages your files/modules
    • http://requirejs.org/




                              @dtauer
Use a good code editor
   Above all, get yourself some code hinting
    and snippets
    • Aptana (http://www.aptana.com/)
    • Sublime Text (http://www.sublimetext.com/)
    • Brackets (https://github.com/adobe/brackets)
       Free, open source
    • Adobe Edge Code
     (http://html.adobe.com/edge/code/)
      Current Version: “Preview”
      Built on Brackets
      Free with Creative Cloud Membership
                            @dtauer
Killer Font: Source Code Pro
http://sourceforge.net/projects/sourcecodepro.ado
be/




                        @dtauer
THANKS!
Dustin Tauer :: Easel Solutions




                    @dtauer

More Related Content

Viewers also liked

External JavaScript Widget Development Best Practices
External JavaScript Widget Development Best PracticesExternal JavaScript Widget Development Best Practices
External JavaScript Widget Development Best PracticesVolkan Özçelik
 
JavaScript Object Oriented Programming Cheat Sheet
JavaScript Object Oriented Programming Cheat SheetJavaScript Object Oriented Programming Cheat Sheet
JavaScript Object Oriented Programming Cheat SheetHDR1001
 
JavaScript Classes and Inheritance
JavaScript Classes and InheritanceJavaScript Classes and Inheritance
JavaScript Classes and Inheritancemarcheiligers
 
Performance Optimization and JavaScript Best Practices
Performance Optimization and JavaScript Best PracticesPerformance Optimization and JavaScript Best Practices
Performance Optimization and JavaScript Best PracticesDoris Chen
 
Object Oriented Programming In JavaScript
Object Oriented Programming In JavaScriptObject Oriented Programming In JavaScript
Object Oriented Programming In JavaScriptForziatech
 
Introduction to NPM and building CLI Tools with Node.js
Introduction to NPM and building CLI Tools with Node.jsIntroduction to NPM and building CLI Tools with Node.js
Introduction to NPM and building CLI Tools with Node.jsSuroor Wijdan
 
JavaScript Basics and Best Practices - CC FE & UX
JavaScript Basics and Best Practices - CC FE & UXJavaScript Basics and Best Practices - CC FE & UX
JavaScript Basics and Best Practices - CC FE & UXJWORKS powered by Ordina
 
Advanced javascript
Advanced javascriptAdvanced javascript
Advanced javascriptDoeun KOCH
 
Beginning Object-Oriented JavaScript
Beginning Object-Oriented JavaScriptBeginning Object-Oriented JavaScript
Beginning Object-Oriented JavaScriptStoyan Stefanov
 
Nodejs Explained with Examples
Nodejs Explained with ExamplesNodejs Explained with Examples
Nodejs Explained with ExamplesGabriele Lana
 
Anatomy of a Modern Node.js Application Architecture
Anatomy of a Modern Node.js Application Architecture Anatomy of a Modern Node.js Application Architecture
Anatomy of a Modern Node.js Application Architecture AppDynamics
 
Intro to Functional Programming
Intro to Functional ProgrammingIntro to Functional Programming
Intro to Functional ProgrammingHugo Firth
 

Viewers also liked (20)

Js style presentation
Js style presentationJs style presentation
Js style presentation
 
JavaScript and OOP
JavaScript and OOPJavaScript and OOP
JavaScript and OOP
 
NPM THE GUIDE
NPM THE GUIDENPM THE GUIDE
NPM THE GUIDE
 
External JavaScript Widget Development Best Practices
External JavaScript Widget Development Best PracticesExternal JavaScript Widget Development Best Practices
External JavaScript Widget Development Best Practices
 
Css Specificity
Css SpecificityCss Specificity
Css Specificity
 
JavaScript Object Oriented Programming Cheat Sheet
JavaScript Object Oriented Programming Cheat SheetJavaScript Object Oriented Programming Cheat Sheet
JavaScript Object Oriented Programming Cheat Sheet
 
JavaScript Classes and Inheritance
JavaScript Classes and InheritanceJavaScript Classes and Inheritance
JavaScript Classes and Inheritance
 
npm
npmnpm
npm
 
Performance Optimization and JavaScript Best Practices
Performance Optimization and JavaScript Best PracticesPerformance Optimization and JavaScript Best Practices
Performance Optimization and JavaScript Best Practices
 
OOP in JavaScript
OOP in JavaScriptOOP in JavaScript
OOP in JavaScript
 
Object Oriented Programming In JavaScript
Object Oriented Programming In JavaScriptObject Oriented Programming In JavaScript
Object Oriented Programming In JavaScript
 
Introduction to NPM and building CLI Tools with Node.js
Introduction to NPM and building CLI Tools with Node.jsIntroduction to NPM and building CLI Tools with Node.js
Introduction to NPM and building CLI Tools with Node.js
 
JavaScript Basics and Best Practices - CC FE & UX
JavaScript Basics and Best Practices - CC FE & UXJavaScript Basics and Best Practices - CC FE & UX
JavaScript Basics and Best Practices - CC FE & UX
 
Advanced javascript
Advanced javascriptAdvanced javascript
Advanced javascript
 
Beginning Object-Oriented JavaScript
Beginning Object-Oriented JavaScriptBeginning Object-Oriented JavaScript
Beginning Object-Oriented JavaScript
 
Introduction Node.js
Introduction Node.jsIntroduction Node.js
Introduction Node.js
 
NodeJS for Beginner
NodeJS for BeginnerNodeJS for Beginner
NodeJS for Beginner
 
Nodejs Explained with Examples
Nodejs Explained with ExamplesNodejs Explained with Examples
Nodejs Explained with Examples
 
Anatomy of a Modern Node.js Application Architecture
Anatomy of a Modern Node.js Application Architecture Anatomy of a Modern Node.js Application Architecture
Anatomy of a Modern Node.js Application Architecture
 
Intro to Functional Programming
Intro to Functional ProgrammingIntro to Functional Programming
Intro to Functional Programming
 

Similar to OOP and JavaScript

jQuery Makes Writing JavaScript Fun Again (for HTML5 User Group)
jQuery Makes Writing JavaScript Fun Again (for HTML5 User Group)jQuery Makes Writing JavaScript Fun Again (for HTML5 User Group)
jQuery Makes Writing JavaScript Fun Again (for HTML5 User Group)Doris Chen
 
Microsoft PowerPoint - <b>jQuery</b>-1-Ajax.pptx
Microsoft PowerPoint - <b>jQuery</b>-1-Ajax.pptxMicrosoft PowerPoint - <b>jQuery</b>-1-Ajax.pptx
Microsoft PowerPoint - <b>jQuery</b>-1-Ajax.pptxtutorialsruby
 
<img src="../i/r_14.png" />
<img src="../i/r_14.png" /><img src="../i/r_14.png" />
<img src="../i/r_14.png" />tutorialsruby
 
Familiar HTML5 - 事例とサンプルコードから学ぶ 身近で普通に使わているHTML5
Familiar HTML5 - 事例とサンプルコードから学ぶ 身近で普通に使わているHTML5Familiar HTML5 - 事例とサンプルコードから学ぶ 身近で普通に使わているHTML5
Familiar HTML5 - 事例とサンプルコードから学ぶ 身近で普通に使わているHTML5Sadaaki HIRAI
 
Ajax with DWR
Ajax with DWRAjax with DWR
Ajax with DWRgouthamrv
 
Groovy Introduction - JAX Germany - 2008
Groovy Introduction - JAX Germany - 2008Groovy Introduction - JAX Germany - 2008
Groovy Introduction - JAX Germany - 2008Guillaume Laforge
 
Groovy Update - JavaPolis 2007
Groovy Update - JavaPolis 2007Groovy Update - JavaPolis 2007
Groovy Update - JavaPolis 2007Guillaume Laforge
 
Javascript Frameworks Comparison - Angular, Knockout, Ember and Backbone
Javascript Frameworks Comparison - Angular, Knockout, Ember and BackboneJavascript Frameworks Comparison - Angular, Knockout, Ember and Backbone
Javascript Frameworks Comparison - Angular, Knockout, Ember and BackboneDeepu S Nath
 
From Java to Ruby...and Back
From Java to Ruby...and BackFrom Java to Ruby...and Back
From Java to Ruby...and BackAnil Hemrajani
 
Beyond Fluffy Bunny. How I leveraged WebObjects in my lean startup.
Beyond Fluffy Bunny. How I leveraged WebObjects in my lean startup.Beyond Fluffy Bunny. How I leveraged WebObjects in my lean startup.
Beyond Fluffy Bunny. How I leveraged WebObjects in my lean startup.WO Community
 
JavaScript 2.0 in Dreamweaver CS4
JavaScript 2.0 in Dreamweaver CS4JavaScript 2.0 in Dreamweaver CS4
JavaScript 2.0 in Dreamweaver CS4alexsaves
 
Ruby on Rails 3.1: Let's bring the fun back into web programing
Ruby on Rails 3.1: Let's bring the fun back into web programingRuby on Rails 3.1: Let's bring the fun back into web programing
Ruby on Rails 3.1: Let's bring the fun back into web programingBozhidar Batsov
 
Advanced #6 clean architecture
Advanced #6  clean architectureAdvanced #6  clean architecture
Advanced #6 clean architectureVitali Pekelis
 

Similar to OOP and JavaScript (20)

jQuery Makes Writing JavaScript Fun Again (for HTML5 User Group)
jQuery Makes Writing JavaScript Fun Again (for HTML5 User Group)jQuery Makes Writing JavaScript Fun Again (for HTML5 User Group)
jQuery Makes Writing JavaScript Fun Again (for HTML5 User Group)
 
Microsoft PowerPoint - <b>jQuery</b>-1-Ajax.pptx
Microsoft PowerPoint - <b>jQuery</b>-1-Ajax.pptxMicrosoft PowerPoint - <b>jQuery</b>-1-Ajax.pptx
Microsoft PowerPoint - <b>jQuery</b>-1-Ajax.pptx
 
<img src="../i/r_14.png" />
<img src="../i/r_14.png" /><img src="../i/r_14.png" />
<img src="../i/r_14.png" />
 
jQuery-1-Ajax
jQuery-1-AjaxjQuery-1-Ajax
jQuery-1-Ajax
 
jQuery-1-Ajax
jQuery-1-AjaxjQuery-1-Ajax
jQuery-1-Ajax
 
Familiar HTML5 - 事例とサンプルコードから学ぶ 身近で普通に使わているHTML5
Familiar HTML5 - 事例とサンプルコードから学ぶ 身近で普通に使わているHTML5Familiar HTML5 - 事例とサンプルコードから学ぶ 身近で普通に使わているHTML5
Familiar HTML5 - 事例とサンプルコードから学ぶ 身近で普通に使わているHTML5
 
Ajax with DWR
Ajax with DWRAjax with DWR
Ajax with DWR
 
Groovy Introduction - JAX Germany - 2008
Groovy Introduction - JAX Germany - 2008Groovy Introduction - JAX Germany - 2008
Groovy Introduction - JAX Germany - 2008
 
Demo eclipse science
Demo eclipse scienceDemo eclipse science
Demo eclipse science
 
Demo Eclipse Science
Demo Eclipse ScienceDemo Eclipse Science
Demo Eclipse Science
 
Groovy Update - JavaPolis 2007
Groovy Update - JavaPolis 2007Groovy Update - JavaPolis 2007
Groovy Update - JavaPolis 2007
 
Javascript Frameworks Comparison - Angular, Knockout, Ember and Backbone
Javascript Frameworks Comparison - Angular, Knockout, Ember and BackboneJavascript Frameworks Comparison - Angular, Knockout, Ember and Backbone
Javascript Frameworks Comparison - Angular, Knockout, Ember and Backbone
 
Scala Introduction
Scala IntroductionScala Introduction
Scala Introduction
 
From Java to Ruby...and Back
From Java to Ruby...and BackFrom Java to Ruby...and Back
From Java to Ruby...and Back
 
Drupal 7 ninja theming
Drupal 7 ninja themingDrupal 7 ninja theming
Drupal 7 ninja theming
 
Beyond Fluffy Bunny. How I leveraged WebObjects in my lean startup.
Beyond Fluffy Bunny. How I leveraged WebObjects in my lean startup.Beyond Fluffy Bunny. How I leveraged WebObjects in my lean startup.
Beyond Fluffy Bunny. How I leveraged WebObjects in my lean startup.
 
JavaScript 2.0 in Dreamweaver CS4
JavaScript 2.0 in Dreamweaver CS4JavaScript 2.0 in Dreamweaver CS4
JavaScript 2.0 in Dreamweaver CS4
 
Nodejs - A quick tour (v5)
Nodejs - A quick tour (v5)Nodejs - A quick tour (v5)
Nodejs - A quick tour (v5)
 
Ruby on Rails 3.1: Let's bring the fun back into web programing
Ruby on Rails 3.1: Let's bring the fun back into web programingRuby on Rails 3.1: Let's bring the fun back into web programing
Ruby on Rails 3.1: Let's bring the fun back into web programing
 
Advanced #6 clean architecture
Advanced #6  clean architectureAdvanced #6  clean architecture
Advanced #6 clean architecture
 

More from easelsolutions

MIMA 2014 - Changing your Responsive Design Workflow
MIMA 2014 - Changing your Responsive Design WorkflowMIMA 2014 - Changing your Responsive Design Workflow
MIMA 2014 - Changing your Responsive Design Workfloweaselsolutions
 
Nebraska Trainer's Institute eLearning Presentaiotn
Nebraska Trainer's Institute eLearning PresentaiotnNebraska Trainer's Institute eLearning Presentaiotn
Nebraska Trainer's Institute eLearning Presentaiotneaselsolutions
 
Building iOS apps with eLearning Tools
Building iOS apps with eLearning ToolsBuilding iOS apps with eLearning Tools
Building iOS apps with eLearning Toolseaselsolutions
 
Strategies for Mobile eLearning
Strategies for Mobile eLearningStrategies for Mobile eLearning
Strategies for Mobile eLearningeaselsolutions
 
Fast Track to Adobe Captivate
Fast Track to Adobe CaptivateFast Track to Adobe Captivate
Fast Track to Adobe Captivateeaselsolutions
 
Trainers Institute eLearning Presentation
Trainers Institute eLearning PresentationTrainers Institute eLearning Presentation
Trainers Institute eLearning Presentationeaselsolutions
 
Multiscreen Development with Adobe Air
Multiscreen Development with Adobe AirMultiscreen Development with Adobe Air
Multiscreen Development with Adobe Aireaselsolutions
 
Flex multi-screen development
Flex multi-screen developmentFlex multi-screen development
Flex multi-screen developmenteaselsolutions
 
Mobile Development with Adobe AIR
Mobile Development with Adobe AIRMobile Development with Adobe AIR
Mobile Development with Adobe AIReaselsolutions
 

More from easelsolutions (11)

MIMA 2014 - Changing your Responsive Design Workflow
MIMA 2014 - Changing your Responsive Design WorkflowMIMA 2014 - Changing your Responsive Design Workflow
MIMA 2014 - Changing your Responsive Design Workflow
 
Nebraska Trainer's Institute eLearning Presentaiotn
Nebraska Trainer's Institute eLearning PresentaiotnNebraska Trainer's Institute eLearning Presentaiotn
Nebraska Trainer's Institute eLearning Presentaiotn
 
Building iOS apps with eLearning Tools
Building iOS apps with eLearning ToolsBuilding iOS apps with eLearning Tools
Building iOS apps with eLearning Tools
 
Strategies for Mobile eLearning
Strategies for Mobile eLearningStrategies for Mobile eLearning
Strategies for Mobile eLearning
 
Fast Track to Adobe Captivate
Fast Track to Adobe CaptivateFast Track to Adobe Captivate
Fast Track to Adobe Captivate
 
eLearning and Mobile
eLearning and MobileeLearning and Mobile
eLearning and Mobile
 
Trainers Institute eLearning Presentation
Trainers Institute eLearning PresentationTrainers Institute eLearning Presentation
Trainers Institute eLearning Presentation
 
Adobe MAX Recap
Adobe MAX RecapAdobe MAX Recap
Adobe MAX Recap
 
Multiscreen Development with Adobe Air
Multiscreen Development with Adobe AirMultiscreen Development with Adobe Air
Multiscreen Development with Adobe Air
 
Flex multi-screen development
Flex multi-screen developmentFlex multi-screen development
Flex multi-screen development
 
Mobile Development with Adobe AIR
Mobile Development with Adobe AIRMobile Development with Adobe AIR
Mobile Development with Adobe AIR
 

OOP and JavaScript

  • 1. JavaScript + OOP Dustin Tauer :: Easel Solution @dtauer
  • 2. Dustin Tauer Developer (11 years) Instructor (7 years) Web :: Mobile :: eLearning @dtauer
  • 3. Easel Solutions  Training • Design, Web, Mobile, eLearning, Strategy, Social, etc.  Customized Training  Consulting  Adobe Connect @dtauer
  • 4. Topics  OOP Techniques • Scope • Classes • Public/Private • Inheritance  A bit of framework talk • RequireJS, BackboneJS, etc @dtauer
  • 5. Who’s down with OOP? Classes, Inheritance, Interfaces, etc. @dtauer
  • 6. Flash History 1997 2006 2012 Flash Flash Flash Player Player Player 2 9* 11.4 2003 2008 Flash Flash Player Player 5 10 @dtauer
  • 7. .Net History 2002 2006 2012 v1.0 v3.0 v4.5 2005 2010 v2.0 v4.0 @dtauer
  • 8. JavaScript History 1996 JavaScript Is that it? 2005 AJAX @dtauer
  • 9. Languages need to evolve to survive JavaScript has survived because of frameworks @dtauer
  • 10. JavaScript is like cement Foundation for frameworks build on @dtauer
  • 11. JavaScript is Object Oriented Polymorphism, encapsulation, and inheritance are all possible. @dtauer
  • 12. Most OOP languages have keywords class, extends, implements, override, public, private, protected, final @dtauer
  • 13. jQuery Plugin (Class) (function($){ $.yourPluginName = function(el, radius, options){ var base = this; base.$el = $(el); base.el = el; base.$el.data("yourPluginName", base); base.init = function(){ if( typeof( radius ) === "undefined" || radius === null ) radius = "20px"; base.radius = radius; base.options = $.extend({},$.yourPluginName.defaultOptions, options); }; base.init(); }; $.yourPluginName.defaultOptions = { radius: "20px" }; $.fn.yourPluginName = function(radius, options){ return this.each(function(){ (new $.yourPluginName(this, radius, options)); }); }; @dtauer
  • 14. Why are they doing it that way? Less stuff in memory (scope) @dtauer
  • 15. Demo No frameworks :: Just JavaScript @dtauer
  • 16. Please, use a framework  There are far too many to list • TodoMVC is a good resource • http://todomvc.com/  RequireJS is manditory • Manages your files/modules • http://requirejs.org/ @dtauer
  • 17. Use a good code editor  Above all, get yourself some code hinting and snippets • Aptana (http://www.aptana.com/) • Sublime Text (http://www.sublimetext.com/) • Brackets (https://github.com/adobe/brackets)  Free, open source • Adobe Edge Code (http://html.adobe.com/edge/code/)  Current Version: “Preview”  Built on Brackets  Free with Creative Cloud Membership @dtauer
  • 18. Killer Font: Source Code Pro http://sourceforge.net/projects/sourcecodepro.ado be/ @dtauer
  • 19. THANKS! Dustin Tauer :: Easel Solutions @dtauer