Your SlideShare is downloading. ×
0
Download PPT
Download PPT
Download PPT
Download PPT
Download PPT
Download PPT
Download PPT
Download PPT
Download PPT
Download PPT
Download PPT
Download PPT
Download PPT
Download PPT
Download PPT
Download PPT
Download PPT
Download PPT
Download PPT
Download PPT
Download PPT
Download PPT
Download PPT
Download PPT
Download PPT
Download PPT
Upcoming SlideShare
Loading in...5
×

Thanks for flagging this SlideShare!

Oops! An error has occurred.

×
Saving this for later? Get the SlideShare app to save on your phone or tablet. Read anywhere, anytime – even offline.
Text the download link to your phone
Standard text messaging rates apply

Download PPT

1,692

Published on

0 Comments
0 Likes
Statistics
Notes
  • Be the first to comment

  • Be the first to like this

No Downloads
Views
Total Views
1,692
On Slideshare
0
From Embeds
0
Number of Embeds
0
Actions
Shares
0
Downloads
20
Comments
0
Likes
0
Embeds 0
No embeds

Report content
Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
No notes for slide

Transcript

  • 1. New York PHP Conference 2006 Download this presentation http://www.jaisenmathai.com/talks/nyphpcon2006/
  • 2. <ul><li>About myself </li></ul><ul><ul><li>I started doing web development in the late 90's </li></ul></ul><ul><ul><li>I currently work at FotoFlix where we are building an online photo sharing/management application </li></ul></ul><ul><ul><li>Prior to FotoFlix I worked at General Motors and Clear Channel Communications </li></ul></ul>
  • 3. <ul><li>Overview </li></ul><ul><ul><li>What is JSON? </li></ul></ul><ul><ul><li>What is AJAX? </li></ul></ul><ul><ul><li>Why do PHP, JSON and AJAX make a great team? </li></ul></ul><ul><ul><li>How can you prepare to implement PHP, JSON and AJAX into your web application? </li></ul></ul>
  • 4. <ul><li>What is JSON? </li></ul><ul><ul><li>JavaScript Object Notation </li></ul></ul><ul><ul><li>It is an extremely lightweight data-interchange format </li></ul></ul><ul><ul><li>JSON is language independant but uses conventions that are familiar to programmers of the C family of languages </li></ul></ul><ul><ul><ul><ul><li>This includes JavaScript, Perl, Python etc. </li></ul></ul></ul></ul>
  • 5. <ul><li>What does JSON look like? </li></ul><ul><ul><li>Arrays </li></ul></ul><ul><ul><ul><ul><li>[456,7390,96748,142] </li></ul></ul></ul></ul><ul><ul><ul><ul><li>[“php”, “perl”, “python”] </li></ul></ul></ul></ul><ul><ul><ul><ul><li>[673, “new york”] </li></ul></ul></ul></ul><ul><ul><li>Objects </li></ul></ul><ul><ul><ul><ul><li>{“username”: “guest”, “password”: “secret”} </li></ul></ul></ul></ul><ul><ul><li>Nested </li></ul></ul><ul><ul><ul><ul><li>{“userData”: {“username”: “guest”, “password”: “secret”}, “Ids”:[1,2,3]} </li></ul></ul></ul></ul>
  • 6. <ul><li>What are the benefits of JSON? </li></ul><ul><ul><li>It is very efficient </li></ul></ul><ul><ul><li>Data exchange between client and server is trivial </li></ul></ul><ul><ul><li>Native support for JSON can be compiled into PHP using PECL or alternatively a PEAR library is available </li></ul></ul><ul><ul><ul><ul><li>The compiled support is extremely fast </li></ul></ul></ul></ul><ul><ul><li>JSON offers a unique solution to the problem of cross domain scripting </li></ul></ul><ul><ul><ul><ul><li>We will be looking at an example of this later </li></ul></ul></ul></ul>
  • 7. <ul><li>What about XML? </li></ul><ul><ul><li>Developers are often looking for a good way to exchange data </li></ul></ul><ul><ul><ul><ul><li>JSON allows developers to focus on the data instead of worrying about parsing the data back and forth from XML to a native data type </li></ul></ul></ul></ul><ul><ul><li>JSON lets developers pass data back and forth from PHP to JavaScript drastically reducing development time </li></ul></ul>
  • 8. <ul><li>When not to use JSON </li></ul><ul><ul><li>Some applications and libraries choose to use other formats to exchange data and may make the use of JSON a poor decision </li></ul></ul><ul><ul><li>Use JSON where it makes sense </li></ul></ul>
  • 9. Launch Yahoo! Example
  • 10. <ul><li>Overview </li></ul><ul><ul><li>What is JSON? </li></ul></ul><ul><ul><li>What is AJAX? </li></ul></ul><ul><ul><li>Why do PHP, JSON and AJAX make a great team? </li></ul></ul><ul><ul><li>How can you prepare to implement PHP, JSON and AJAX into your web application? </li></ul></ul>
  • 11. <ul><li>What is AJAX? </li></ul><ul><ul><li>Asynchronous JavaScript and XML </li></ul></ul><ul><ul><li>Define AJAX for this session </li></ul></ul><ul><ul><ul><ul><li>For this session the term AJAX is NOT limited to a specific set of technologies </li></ul></ul></ul></ul><ul><ul><ul><ul><li>We will look at AJAX as an alternative method for a client and server to interact through a web page </li></ul></ul></ul></ul>
  • 12. <ul><li>AJAX is a new term but it is not a new technology </li></ul><ul><ul><li>Microsoft added support for asynchronous scripting in IE 5 </li></ul></ul><ul><ul><li>Prior to IE 5 IFRAMEs were used to achieve these effects </li></ul></ul><ul><ul><li>Google maps is arguably the first AJAX application that got people thinking about new ways to build web applications </li></ul></ul>
  • 13. <ul><li>What are the benefits of AJAX? </li></ul><ul><ul><li>AJAX can improve user experience </li></ul></ul><ul><ul><ul><ul><li>A user can interact with a web page without having to wait for the page to reload </li></ul></ul></ul></ul><ul><ul><ul><ul><li>The perceived responsiveness of a web page can be drastically increased </li></ul></ul></ul></ul>
  • 14. <ul><li>Some common pitfalls of AJAX </li></ul><ul><ul><li>Like any technology that gets a lot of attention AJAX can be misused </li></ul></ul><ul><ul><li>It is important to identify what portions of your application would benefit from AJAX </li></ul></ul>
  • 15. Launch Zip Code Example
  • 16. <ul><li>Overview </li></ul><ul><ul><li>What is JSON? </li></ul></ul><ul><ul><li>What is AJAX? </li></ul></ul><ul><ul><li>Why do PHP, JSON and AJAX make a great team? </li></ul></ul><ul><ul><li>How can you prepare to implement PHP, JSON and AJAX into your web application? </li></ul></ul>
  • 17. <ul><li>Why do PHP, JSON and AJAX make such a great team? </li></ul><ul><ul><li>Because AJAX requires frequent data exchange between PHP on the server and JavaScript on the client... JSON is a natural choice </li></ul></ul>
  • 18. <ul><li>Can these technologies help your application scale? </li></ul><ul><ul><li>When implemented properly you can minimize bandwidth and server load </li></ul></ul><ul><ul><li>The server can send data to the client using JSON and the client's machine can render the data </li></ul></ul><ul><ul><ul><ul><li>This saves bandwidth </li></ul></ul></ul></ul><ul><ul><li>Infrequently requested data can be served to the client on demand resulting in a decrease in the number of database queries executed </li></ul></ul><ul><ul><ul><ul><li>This reduces the load on the server </li></ul></ul></ul></ul>
  • 19. Launch PHP, JSON and AJAX Example
  • 20. <ul><li>Overview </li></ul><ul><ul><li>What is JSON? </li></ul></ul><ul><ul><li>What is AJAX? </li></ul></ul><ul><ul><li>Why do PHP, JSON and AJAX make a great team? </li></ul></ul><ul><ul><li>How can you prepare to implement PHP, JSON and AJAX into your web application? </li></ul></ul>
  • 21. <ul><li>What you need to know to begin implementing these technologies </li></ul><ul><ul><li>Marking up a web page is very different from scripting a web page </li></ul></ul><ul><ul><li>Developing AJAX applications requires a different skillset than traditional web applications </li></ul></ul><ul><ul><ul><ul><li>Requires the developer to be fluent in PHP and JavaScript </li></ul></ul></ul></ul>
  • 22. <ul><li>How do you put together a good team? </li></ul><ul><ul><li>Find developers with strong skills in both PHP and JavaScript </li></ul></ul><ul><ul><li>It will be hard to find developers with lots of experience with AJAX and JSON because they are relatively new technologies </li></ul></ul><ul><ul><li>Look for developers that are eager to learn </li></ul></ul>
  • 23. <ul><li>How can you equip your team to develop using these technologies? </li></ul><ul><ul><li>Give them time to research the topics using online resources </li></ul></ul><ul><ul><li>Give them an existing problem to “fix” or “improve” </li></ul></ul><ul><ul><li>Send a lead developer to a conference covering these topics... like this one </li></ul></ul>
  • 24. <ul><li>Overview </li></ul><ul><ul><li>What is JSON? </li></ul></ul><ul><ul><li>What is AJAX? </li></ul></ul><ul><ul><li>Why do PHP, JSON and AJAX make a great team? </li></ul></ul><ul><ul><li>How can you prepare to implement PHP, JSON and AJAX into your web application? </li></ul></ul>
  • 25. <ul><li>Resources </li></ul><ul><ul><li>http://www.php.net </li></ul></ul><ul><ul><li>http://www.json.org </li></ul></ul><ul><ul><li>http://www.ajaxian.com/ </li></ul></ul><ul><ul><li>http://pear.php.net/pepr/pepr-proposal-show.php?id=198 </li></ul></ul><ul><ul><li>http://www.aurore.net/projects/php-json/ </li></ul></ul>
  • 26. The End

×