SlideShare a Scribd company logo
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

PPTX
Moo the universe and everything
PDF
Code conventions for the java script programming language (1)
PPT
Javascript Oop
PDF
Java script standards
PPTX
Bringing classical OOP into JavaScript
PDF
Javascript cheat-sheet-v1
PDF
[Frontend 101] JavaScript OOP
PPT
JavaScript OOP
Moo the universe and everything
Code conventions for the java script programming language (1)
Javascript Oop
Java script standards
Bringing classical OOP into JavaScript
Javascript cheat-sheet-v1
[Frontend 101] JavaScript OOP
JavaScript OOP

Viewers also liked (20)

PDF
Js style presentation
PPTX
JavaScript and OOP
PDF
NPM THE GUIDE
PPTX
External JavaScript Widget Development Best Practices
PPT
Css Specificity
ODP
JavaScript Object Oriented Programming Cheat Sheet
KEY
JavaScript Classes and Inheritance
PPTX
PDF
Performance Optimization and JavaScript Best Practices
PPT
OOP in JavaScript
PPTX
Object Oriented Programming In JavaScript
PDF
Introduction to NPM and building CLI Tools with Node.js
PDF
JavaScript Basics and Best Practices - CC FE & UX
PDF
Advanced javascript
PPT
Beginning Object-Oriented JavaScript
PPTX
Introduction Node.js
PDF
NodeJS for Beginner
PDF
Nodejs Explained with Examples
PDF
Anatomy of a Modern Node.js Application Architecture
PDF
Intro to Functional Programming
Js style presentation
JavaScript and OOP
NPM THE GUIDE
External JavaScript Widget Development Best Practices
Css Specificity
JavaScript Object Oriented Programming Cheat Sheet
JavaScript Classes and Inheritance
Performance Optimization and JavaScript Best Practices
OOP in JavaScript
Object Oriented Programming In JavaScript
Introduction to NPM and building CLI Tools with Node.js
JavaScript Basics and Best Practices - CC FE & UX
Advanced javascript
Beginning Object-Oriented JavaScript
Introduction Node.js
NodeJS for Beginner
Nodejs Explained with Examples
Anatomy of a Modern Node.js Application Architecture
Intro to Functional Programming
Ad

Similar to OOP and JavaScript (20)

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

More from easelsolutions (11)

PDF
MIMA 2014 - Changing your Responsive Design Workflow
PPTX
Nebraska Trainer's Institute eLearning Presentaiotn
PPTX
Building iOS apps with eLearning Tools
PPTX
Strategies for Mobile eLearning
PPTX
Fast Track to Adobe Captivate
PPT
eLearning and Mobile
PPTX
Trainers Institute eLearning Presentation
PPTX
Adobe MAX Recap
PPTX
Multiscreen Development with Adobe Air
PPTX
Flex multi-screen development
PPTX
Mobile Development with Adobe AIR
MIMA 2014 - Changing your Responsive Design Workflow
Nebraska Trainer's Institute eLearning Presentaiotn
Building iOS apps with eLearning Tools
Strategies for Mobile eLearning
Fast Track to Adobe Captivate
eLearning and Mobile
Trainers Institute eLearning Presentation
Adobe MAX Recap
Multiscreen Development with Adobe Air
Flex multi-screen development
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