SlideShare uma empresa Scribd logo
1 de 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

Mais conteúdo relacionado

Semelhante a Refresh Events Prototype

Michael Tamblyn - 6 Projects That Could Change Publishing for the Better
Michael Tamblyn - 6 Projects That Could Change Publishing for the BetterMichael Tamblyn - 6 Projects That Could Change Publishing for the Better
Michael Tamblyn - 6 Projects That Could Change Publishing for the BetterBookNet Canada
 
Introduction to Agile and SCRUm
Introduction to Agile and SCRUmIntroduction to Agile and SCRUm
Introduction to Agile and SCRUmSumeet Moghe
 
Introduction to Agile and SCRUM
Introduction to Agile and SCRUMIntroduction to Agile and SCRUM
Introduction to Agile and SCRUMSumeet Moghe
 
Nanite (And An Introduction To Cloud Computing)
Nanite (And An Introduction To Cloud Computing)Nanite (And An Introduction To Cloud Computing)
Nanite (And An Introduction To Cloud Computing)will_j
 
Online marketing (tactical)
Online marketing (tactical)Online marketing (tactical)
Online marketing (tactical)Pinny Gniwisch
 
TimesOpen Keynote: Technology and the Future of the Newspaper
TimesOpen Keynote: Technology and the Future of the NewspaperTimesOpen Keynote: Technology and the Future of the Newspaper
TimesOpen Keynote: Technology and the Future of the NewspaperTim O'Reilly
 
The State of the Web: back to the Middle Ages
The State of the Web: back to the Middle AgesThe State of the Web: back to the Middle Ages
The State of the Web: back to the Middle AgesBart De Waele
 
Vladimir Oane
Vladimir OaneVladimir Oane
Vladimir Oaneevensys
 
Building a website, McGill Course
Building a website, McGill CourseBuilding a website, McGill Course
Building a website, McGill CoursePinny Gniwisch
 
Designing Your Future:Networking without the Ick
Designing Your Future:Networking without the IckDesigning Your Future:Networking without the Ick
Designing Your Future:Networking without the IckCindy Li
 
090514 Circom The Future Of Tv Today
090514 Circom   The Future Of Tv Today090514 Circom   The Future Of Tv Today
090514 Circom The Future Of Tv TodayVincent Everts
 
Web2.0 - wat is dat beest?
Web2.0 - wat is dat beest?Web2.0 - wat is dat beest?
Web2.0 - wat is dat beest?Bart De Waele
 
21c School Libraries Leading Learning
21c School Libraries Leading Learning21c School Libraries Leading Learning
21c School Libraries Leading LearningJudy O'Connell
 
Web 2.0 - Teaching and Learning in the Cloud
Web 2.0 - Teaching and Learning in the CloudWeb 2.0 - Teaching and Learning in the Cloud
Web 2.0 - Teaching and Learning in the CloudChris Penny
 
Flash Lite Optimization
Flash Lite OptimizationFlash Lite Optimization
Flash Lite OptimizationThomas Joos
 

Semelhante a Refresh Events Prototype (20)

Michael Tamblyn - 6 Projects That Could Change Publishing for the Better
Michael Tamblyn - 6 Projects That Could Change Publishing for the BetterMichael Tamblyn - 6 Projects That Could Change Publishing for the Better
Michael Tamblyn - 6 Projects That Could Change Publishing for the Better
 
Introduction to Agile and SCRUm
Introduction to Agile and SCRUmIntroduction to Agile and SCRUm
Introduction to Agile and SCRUm
 
Introduction to Agile and SCRUM
Introduction to Agile and SCRUMIntroduction to Agile and SCRUM
Introduction to Agile and SCRUM
 
Nanite (And An Introduction To Cloud Computing)
Nanite (And An Introduction To Cloud Computing)Nanite (And An Introduction To Cloud Computing)
Nanite (And An Introduction To Cloud Computing)
 
Edo Cabinet
Edo CabinetEdo Cabinet
Edo Cabinet
 
Bnc Pd Day Bellwoods
Bnc Pd Day BellwoodsBnc Pd Day Bellwoods
Bnc Pd Day Bellwoods
 
Online marketing (tactical)
Online marketing (tactical)Online marketing (tactical)
Online marketing (tactical)
 
TimesOpen Keynote: Technology and the Future of the Newspaper
TimesOpen Keynote: Technology and the Future of the NewspaperTimesOpen Keynote: Technology and the Future of the Newspaper
TimesOpen Keynote: Technology and the Future of the Newspaper
 
The State of the Web: back to the Middle Ages
The State of the Web: back to the Middle AgesThe State of the Web: back to the Middle Ages
The State of the Web: back to the Middle Ages
 
Vladimir Oane
Vladimir OaneVladimir Oane
Vladimir Oane
 
Building a website, McGill Course
Building a website, McGill CourseBuilding a website, McGill Course
Building a website, McGill Course
 
Diggin Diigo
Diggin DiigoDiggin Diigo
Diggin Diigo
 
Designing Your Future:Networking without the Ick
Designing Your Future:Networking without the IckDesigning Your Future:Networking without the Ick
Designing Your Future:Networking without the Ick
 
090514 Circom The Future Of Tv Today
090514 Circom   The Future Of Tv Today090514 Circom   The Future Of Tv Today
090514 Circom The Future Of Tv Today
 
Ethics
EthicsEthics
Ethics
 
Linq Refresher
Linq RefresherLinq Refresher
Linq Refresher
 
Web2.0 - wat is dat beest?
Web2.0 - wat is dat beest?Web2.0 - wat is dat beest?
Web2.0 - wat is dat beest?
 
21c School Libraries Leading Learning
21c School Libraries Leading Learning21c School Libraries Leading Learning
21c School Libraries Leading Learning
 
Web 2.0 - Teaching and Learning in the Cloud
Web 2.0 - Teaching and Learning in the CloudWeb 2.0 - Teaching and Learning in the Cloud
Web 2.0 - Teaching and Learning in the Cloud
 
Flash Lite Optimization
Flash Lite OptimizationFlash Lite Optimization
Flash Lite Optimization
 

Último

Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsJoaquim Jorge
 
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 DevelopmentsTrustArc
 
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...Neo4j
 
Tech Trends Report 2024 Future Today Institute.pdf
Tech Trends Report 2024 Future Today Institute.pdfTech Trends Report 2024 Future Today Institute.pdf
Tech Trends Report 2024 Future Today Institute.pdfhans926745
 
GenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdfGenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdflior mazor
 
Developing An App To Navigate The Roads of Brazil
Developing An App To Navigate The Roads of BrazilDeveloping An App To Navigate The Roads of Brazil
Developing An App To Navigate The Roads of BrazilV3cube
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProduct Anonymous
 
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?Igalia
 
What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?Antenna Manufacturer Coco
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Drew Madelung
 
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 RobisonAnna Loughnan Colquhoun
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Scriptwesley chun
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Miguel Araújo
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerThousandEyes
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)Gabriella Davis
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘RTylerCroy
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityPrincipled Technologies
 
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUnderstanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUK Journal
 
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 CVKhem
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slidevu2urc
 

Último (20)

Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and Myths
 
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
 
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...
 
Tech Trends Report 2024 Future Today Institute.pdf
Tech Trends Report 2024 Future Today Institute.pdfTech Trends Report 2024 Future Today Institute.pdf
Tech Trends Report 2024 Future Today Institute.pdf
 
GenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdfGenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdf
 
Developing An App To Navigate The Roads of Brazil
Developing An App To Navigate The Roads of BrazilDeveloping An App To Navigate The Roads of Brazil
Developing An App To Navigate The Roads of Brazil
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
 
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?
 
What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
 
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
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Script
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivity
 
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUnderstanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
 
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
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slide
 

Refresh Events Prototype

Notas do Editor

  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.