SlideShare une entreprise Scribd logo
1  sur  40
Thursday, February 19, 2009
Agenda

                    • General Framework Overview
                    • What Prototype Isn’t
                    • The Ninja Database
                    • Questions?

Thursday, February 19, 2009
jQuery
                               Awesome.




Thursday, February 19, 2009
Prototype
                                Awesome.




Thursday, February 19, 2009
Frameworks
                                 Awesome.




Thursday, February 19, 2009
Javascript
                                Awesome.




Thursday, February 19, 2009
Browsers?



Thursday, February 19, 2009
Prototype ==
                                 jQuery
                 Come on, they all basically do the same thing.




Thursday, February 19, 2009
Ruby in the
                               Browser?
                                 Not quite.




Thursday, February 19, 2009
AJAX
                              The umbrella term




Thursday, February 19, 2009
So why Prototype?



Thursday, February 19, 2009
Light as a … NO.
Thursday, February 19, 2009
Quick as a … NO.
Thursday, February 19, 2009
jQuery is Champ.
Thursday, February 19, 2009
Prototype Has
                                    Muscle.
                    • Class Creation
                    • Insertion
                    • DOM Element
                              Creation
                    • Events
                    • Custom Events
                    • Scope Binding
                    • AJAX

Thursday, February 19, 2009
The Ninja Database



Thursday, February 19, 2009
Thursday, February 19, 2009
Controlling Class
                Instance via Firebug
                    • Creating a class instance with
                              optional parameters

                    • Inserting custom instances into the
                              DOM

                    • Accessing the public API of a class
                              instance

                    • Class instances maintain state
Thursday, February 19, 2009
Thursday, February 19, 2009
Controlling Class
                Instance via Firebug
                    • Creating a class instance with
                              optional parameters

                    • Inserting custom instances into the
                              DOM

                    • Accessing the public API of a class
                              instance

                    • Class instances maintain state
Thursday, February 19, 2009
But what does the
                         DOM look like?


Thursday, February 19, 2009
Thursday, February 19, 2009
How is this
                     elegance possible?


Thursday, February 19, 2009
Constructors




Thursday, February 19, 2009
Overwrite Options
                            During




Thursday, February 19, 2009
Insert Anything.
                                Element#insert(anything);




Thursday, February 19, 2009
Programmatically
                           Create Elements




Thursday, February 19, 2009
Events
                 Use the DOM as a notification system for your
                                   class.




Thursday, February 19, 2009
Standard DOM
                                  Events




Thursday, February 19, 2009
Standard DOM
                                  Events




Thursday, February 19, 2009
Standard DOM
                                     Events



                                          Function#bind(this)
                                        Your best friend when using classes.
                              Allows referencing instance variables in an event listener.



Thursday, February 19, 2009
Custom Events Too




Thursday, February 19, 2009
Custom Events Too




Thursday, February 19, 2009
Custom Events Too




Thursday, February 19, 2009
Custom Events Too




Thursday, February 19, 2009
Custom Events Too




Thursday, February 19, 2009
AJAX
                              Everybody’s doing it.




Thursday, February 19, 2009
Thursday, February 19, 2009
Evaluate JSON




Thursday, February 19, 2009
Questions?

                    • http://github.com/camwest/
                              refresh-prototype-talk

                    • http://bigbangtechnology.com/blog



Thursday, February 19, 2009

Contenu connexe

Plus de Refresh Events

Tamera Kremer - The Social Tools Won't Save You
Tamera Kremer - The Social Tools Won't Save YouTamera Kremer - The Social Tools Won't Save You
Tamera Kremer - The Social Tools Won't Save YouRefresh Events
 
Aubrey Podolsky - Sysomos' Social Media Tools and How To Use Them
Aubrey Podolsky - Sysomos' Social Media Tools and How To Use ThemAubrey Podolsky - Sysomos' Social Media Tools and How To Use Them
Aubrey Podolsky - Sysomos' Social Media Tools and How To Use ThemRefresh Events
 
Lynette Latinsky - Can Lunch Be On Me Today?
Lynette Latinsky - Can Lunch Be On Me Today?Lynette Latinsky - Can Lunch Be On Me Today?
Lynette Latinsky - Can Lunch Be On Me Today?Refresh Events
 
Tim Scollick - Flex, Seo And You
Tim Scollick - Flex, Seo And YouTim Scollick - Flex, Seo And You
Tim Scollick - Flex, Seo And YouRefresh Events
 
Joshua Wehner - Tomorrows Programming Languages Today
Joshua Wehner - Tomorrows Programming Languages TodayJoshua Wehner - Tomorrows Programming Languages Today
Joshua Wehner - Tomorrows Programming Languages TodayRefresh Events
 
Colin Bowern - The Not So Scary Side Of Asp.Net – Model View Controller In Th...
Colin Bowern - The Not So Scary Side Of Asp.Net – Model View Controller In Th...Colin Bowern - The Not So Scary Side Of Asp.Net – Model View Controller In Th...
Colin Bowern - The Not So Scary Side Of Asp.Net – Model View Controller In Th...Refresh Events
 
Ben Vinegar - 5 Tips For Better Javascript Applications
Ben Vinegar - 5 Tips For Better Javascript ApplicationsBen Vinegar - 5 Tips For Better Javascript Applications
Ben Vinegar - 5 Tips For Better Javascript ApplicationsRefresh Events
 
Jonathan Dunn - Talking You Down from the Bleeding Edge
Jonathan Dunn - Talking You Down from the Bleeding EdgeJonathan Dunn - Talking You Down from the Bleeding Edge
Jonathan Dunn - Talking You Down from the Bleeding EdgeRefresh Events
 
Justin Kozuch - Lessons Learned In Community Building
Justin Kozuch - Lessons Learned In Community BuildingJustin Kozuch - Lessons Learned In Community Building
Justin Kozuch - Lessons Learned In Community BuildingRefresh Events
 
Jenmy Huynh - Finding Opportunities
Jenmy Huynh - Finding OpportunitiesJenmy Huynh - Finding Opportunities
Jenmy Huynh - Finding OpportunitiesRefresh Events
 
Adil Dhalla - My City Lives
Adil Dhalla - My City LivesAdil Dhalla - My City Lives
Adil Dhalla - My City LivesRefresh Events
 
Andy Walker - Little Geeks Foundation
Andy Walker - Little Geeks FoundationAndy Walker - Little Geeks Foundation
Andy Walker - Little Geeks FoundationRefresh Events
 
Satish Kanwar - Entrepreneur Versus Employee
Satish Kanwar - Entrepreneur Versus EmployeeSatish Kanwar - Entrepreneur Versus Employee
Satish Kanwar - Entrepreneur Versus EmployeeRefresh Events
 
Dre Labre - The Game Of Opposites
Dre Labre - The Game Of OppositesDre Labre - The Game Of Opposites
Dre Labre - The Game Of OppositesRefresh Events
 
Evelyn So - A Few Social Media Stories
Evelyn So - A Few Social Media StoriesEvelyn So - A Few Social Media Stories
Evelyn So - A Few Social Media StoriesRefresh Events
 
Daniel Patricio: I Hope Mobile Kills Advertising
Daniel Patricio: I Hope Mobile Kills AdvertisingDaniel Patricio: I Hope Mobile Kills Advertising
Daniel Patricio: I Hope Mobile Kills AdvertisingRefresh Events
 
Tom Purves: Designing for An Augmented Reality World
Tom Purves: Designing for An Augmented Reality WorldTom Purves: Designing for An Augmented Reality World
Tom Purves: Designing for An Augmented Reality WorldRefresh Events
 
Jason Sadler: I Wear Your Shirt
Jason Sadler: I Wear Your ShirtJason Sadler: I Wear Your Shirt
Jason Sadler: I Wear Your ShirtRefresh Events
 
Elaine Chen: Mobile Touchphone UI Design 101
Elaine Chen: Mobile Touchphone UI Design 101Elaine Chen: Mobile Touchphone UI Design 101
Elaine Chen: Mobile Touchphone UI Design 101Refresh Events
 

Plus de Refresh Events (20)

Tamera Kremer - The Social Tools Won't Save You
Tamera Kremer - The Social Tools Won't Save YouTamera Kremer - The Social Tools Won't Save You
Tamera Kremer - The Social Tools Won't Save You
 
Aubrey Podolsky - Sysomos' Social Media Tools and How To Use Them
Aubrey Podolsky - Sysomos' Social Media Tools and How To Use ThemAubrey Podolsky - Sysomos' Social Media Tools and How To Use Them
Aubrey Podolsky - Sysomos' Social Media Tools and How To Use Them
 
Lynette Latinsky - Can Lunch Be On Me Today?
Lynette Latinsky - Can Lunch Be On Me Today?Lynette Latinsky - Can Lunch Be On Me Today?
Lynette Latinsky - Can Lunch Be On Me Today?
 
Michael Burke
Michael BurkeMichael Burke
Michael Burke
 
Tim Scollick - Flex, Seo And You
Tim Scollick - Flex, Seo And YouTim Scollick - Flex, Seo And You
Tim Scollick - Flex, Seo And You
 
Joshua Wehner - Tomorrows Programming Languages Today
Joshua Wehner - Tomorrows Programming Languages TodayJoshua Wehner - Tomorrows Programming Languages Today
Joshua Wehner - Tomorrows Programming Languages Today
 
Colin Bowern - The Not So Scary Side Of Asp.Net – Model View Controller In Th...
Colin Bowern - The Not So Scary Side Of Asp.Net – Model View Controller In Th...Colin Bowern - The Not So Scary Side Of Asp.Net – Model View Controller In Th...
Colin Bowern - The Not So Scary Side Of Asp.Net – Model View Controller In Th...
 
Ben Vinegar - 5 Tips For Better Javascript Applications
Ben Vinegar - 5 Tips For Better Javascript ApplicationsBen Vinegar - 5 Tips For Better Javascript Applications
Ben Vinegar - 5 Tips For Better Javascript Applications
 
Jonathan Dunn - Talking You Down from the Bleeding Edge
Jonathan Dunn - Talking You Down from the Bleeding EdgeJonathan Dunn - Talking You Down from the Bleeding Edge
Jonathan Dunn - Talking You Down from the Bleeding Edge
 
Justin Kozuch - Lessons Learned In Community Building
Justin Kozuch - Lessons Learned In Community BuildingJustin Kozuch - Lessons Learned In Community Building
Justin Kozuch - Lessons Learned In Community Building
 
Jenmy Huynh - Finding Opportunities
Jenmy Huynh - Finding OpportunitiesJenmy Huynh - Finding Opportunities
Jenmy Huynh - Finding Opportunities
 
Adil Dhalla - My City Lives
Adil Dhalla - My City LivesAdil Dhalla - My City Lives
Adil Dhalla - My City Lives
 
Andy Walker - Little Geeks Foundation
Andy Walker - Little Geeks FoundationAndy Walker - Little Geeks Foundation
Andy Walker - Little Geeks Foundation
 
Satish Kanwar - Entrepreneur Versus Employee
Satish Kanwar - Entrepreneur Versus EmployeeSatish Kanwar - Entrepreneur Versus Employee
Satish Kanwar - Entrepreneur Versus Employee
 
Dre Labre - The Game Of Opposites
Dre Labre - The Game Of OppositesDre Labre - The Game Of Opposites
Dre Labre - The Game Of Opposites
 
Evelyn So - A Few Social Media Stories
Evelyn So - A Few Social Media StoriesEvelyn So - A Few Social Media Stories
Evelyn So - A Few Social Media Stories
 
Daniel Patricio: I Hope Mobile Kills Advertising
Daniel Patricio: I Hope Mobile Kills AdvertisingDaniel Patricio: I Hope Mobile Kills Advertising
Daniel Patricio: I Hope Mobile Kills Advertising
 
Tom Purves: Designing for An Augmented Reality World
Tom Purves: Designing for An Augmented Reality WorldTom Purves: Designing for An Augmented Reality World
Tom Purves: Designing for An Augmented Reality World
 
Jason Sadler: I Wear Your Shirt
Jason Sadler: I Wear Your ShirtJason Sadler: I Wear Your Shirt
Jason Sadler: I Wear Your Shirt
 
Elaine Chen: Mobile Touchphone UI Design 101
Elaine Chen: Mobile Touchphone UI Design 101Elaine Chen: Mobile Touchphone UI Design 101
Elaine Chen: Mobile Touchphone UI Design 101
 

Dernier

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
 
"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
 
My Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationMy Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationRidwan Fadjar
 
Search Engine Optimization SEO PDF for 2024.pdf
Search Engine Optimization SEO PDF for 2024.pdfSearch Engine Optimization SEO PDF for 2024.pdf
Search Engine Optimization SEO PDF for 2024.pdfRankYa
 
What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024Stephanie Beckett
 
Install Stable Diffusion in windows machine
Install Stable Diffusion in windows machineInstall Stable Diffusion in windows machine
Install Stable Diffusion in windows machinePadma Pradeep
 
Unraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfUnraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfAlex Barbosa Coqueiro
 
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024BookNet Canada
 
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
 
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks..."LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...Fwdays
 
SAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptxSAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptxNavinnSomaal
 
Vertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering TipsVertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering TipsMiki Katsuragi
 
Gen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfGen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfAddepto
 
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
 
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Patryk Bandurski
 
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
 
The Future of Software Development - Devin AI Innovative Approach.pdf
The Future of Software Development - Devin AI Innovative Approach.pdfThe Future of Software Development - Devin AI Innovative Approach.pdf
The Future of Software Development - Devin AI Innovative Approach.pdfSeasiaInfotech2
 
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
 
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
 

Dernier (20)

Commit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easyCommit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easy
 
"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
 
My Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationMy Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 Presentation
 
DMCC Future of Trade Web3 - Special Edition
DMCC Future of Trade Web3 - Special EditionDMCC Future of Trade Web3 - Special Edition
DMCC Future of Trade Web3 - Special Edition
 
Search Engine Optimization SEO PDF for 2024.pdf
Search Engine Optimization SEO PDF for 2024.pdfSearch Engine Optimization SEO PDF for 2024.pdf
Search Engine Optimization SEO PDF for 2024.pdf
 
What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024
 
Install Stable Diffusion in windows machine
Install Stable Diffusion in windows machineInstall Stable Diffusion in windows machine
Install Stable Diffusion in windows machine
 
Unraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfUnraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdf
 
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
 
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
 
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks..."LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
 
SAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptxSAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptx
 
Vertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering TipsVertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering Tips
 
Gen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfGen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdf
 
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
 
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
 
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
 
The Future of Software Development - Devin AI Innovative Approach.pdf
The Future of Software Development - Devin AI Innovative Approach.pdfThe Future of Software Development - Devin AI Innovative Approach.pdf
The Future of Software Development - Devin AI Innovative Approach.pdf
 
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
 
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)
 

Javascript Libraries: Prototype

Notes de l'éditeur

  1. Big Bang Technology, June 2008, Max Cameron, iPhone, Web Dev, Flex Development, Bigbangtechnology.com
  2. abstract away inconsitencies in browser. each does it different functionally equivalent small differences in edge cases
  3. interesting history. one of the first modern JavaScript frameworks designed to mimic the Ruby in the browser.
  4. Interactive sophisticated programs in the browser. Typically without page refreshes.
  5. Most of those accomplishments go to jQuery, and I'd highly recommend using it for most simple JavaScript implementations.
  6. * visual representation of the class instances * events are bound * loaded via ajax from a json feed
  7. Creating a class instance with optional parameters Inserting custom instances into the DOM Accessing the public API of a class instance Class instances maintain state regardless of whether they are in the DOM or not.
  8. explain the html structure of the dom nodes
  9. Object.extend overrides default options with whatever is passed into the constructor If something isn’t passed in, the default value is used
  10. you can take any DOM element and use the .insert method on it to insert custom classes as long as they implement toElement as an instance method.
  11. Element is a class built just like Ninja. It takes two arguments, the tag name, and a hash of attribute values that you’d like to see on the element. Update is an Element method that lets you add elements or text as children
  12. if you don’t use bind on event listeners. “this” references the element that dispatched the event. but we want to reference the class instance to access properties inside it. interpolate makes adding variables to strings a lot easier
  13. custom events need to be bound to dom elements. use custom events for public methods that change the visual appearance of the class
  14. iterate through the JSON to create new class instances for each record found. typically would be database driven. don’t forget to store a reference to the class instance or JavaScript will garbage collect it
  15. Notice how the JSON feed is styled with the same key values as our class constructor options.