download ppt

26
New York PHP Conference 2006 Download this presentation http://www.jaisenmathai.com/talks/ nyphpcon2006/

Upload: sampetruda

Post on 03-Dec-2014

2.054 views

Category:

Documents


1 download

DESCRIPTION

 

TRANSCRIPT

Page 1: Download PPT

New York PHP Conference 2006

Download this presentationhttp://www.jaisenmathai.com/talks/

nyphpcon2006/

Page 2: Download PPT

About myself● I started doing web development in the late 90's

● I currently work at FotoFlix where we are building an online photo sharing/management application

● Prior to FotoFlix I worked at General Motors and Clear Channel Communications

Page 3: Download PPT

Overview● What is JSON?● What is AJAX?● Why do PHP, JSON and AJAX make a great team?

● How can you prepare to implement PHP, JSON and AJAX into your web application?

Page 4: Download PPT

What is JSON?● JavaScript Object Notation● It is an extremely lightweight data-interchange format

● JSON is language independant but uses conventions that are familiar to programmers of the C family of languages

● This includes JavaScript, Perl, Python etc.

Page 5: Download PPT

What does JSON look like?● Arrays

● [456,7390,96748,142]● [“php”, “perl”, “python”]● [673, “new york”]

● Objects● {“username”: “guest”, “password”: “secret”}

● Nested● {“userData”: {“username”: “guest”, “password”: “secret”}, “Ids”:[1,2,3]}

Page 6: Download PPT

What are the benefits of JSON?● It is very efficient● Data exchange between client and server is trivial

● Native support for JSON can be compiled into PHP using PECL or alternatively a PEAR library is available

● The compiled support is extremely fast● JSON offers a unique solution to the problem of cross domain scripting

● We will be looking at an example of this later

Page 7: Download PPT

What about XML?● Developers are often looking for a good way to exchange data

● 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

● JSON lets developers pass data back and forth from PHP to JavaScript drastically reducing development time

Page 8: Download PPT

When not to use JSON● Some applications and libraries choose to use other formats to exchange data and may make the use of JSON a poor decision

● Use JSON where it makes sense

Page 9: Download PPT

Launch Yahoo! Example

Page 10: Download PPT

Overview● What is JSON?● What is AJAX?● Why do PHP, JSON and AJAX make a great team?

● How can you prepare to implement PHP, JSON and AJAX into your web application?

Page 11: Download PPT

What is AJAX?● Asynchronous JavaScript and XML● Define AJAX for this session

● For this session the term AJAX is NOT limited to a specific set of technologies

● We will look at AJAX as an alternative method for a client and server to interact through a web page

Page 12: Download PPT

AJAX is a new term but it is not a new technology

● Microsoft added support for asynchronous scripting in IE 5

● Prior to IE 5 IFRAMEs were used to achieve these effects

● Google maps is arguably the first AJAX application that got people thinking about new ways to build web applications

Page 13: Download PPT

What are the benefits of AJAX?● AJAX can improve user experience

● A user can interact with a web page without having to wait for the page to reload

● The perceived responsiveness of a web page can be drastically increased

Page 14: Download PPT

Some common pitfalls of AJAX● Like any technology that gets a lot of attention AJAX can be misused

● It is important to identify what portions of your application would benefit from AJAX

Page 15: Download PPT

Launch Zip Code Example

Page 16: Download PPT

Overview● What is JSON?● What is AJAX?● Why do PHP, JSON and AJAX make a great team?

● How can you prepare to implement PHP, JSON and AJAX into your web application?

Page 17: Download PPT

Why do PHP, JSON and AJAX make such a great team?

● Because AJAX requires frequent data exchange between PHP on the server and JavaScript on the client...JSON is a natural choice

Page 18: Download PPT

Can these technologies help your application scale?

● When implemented properly you can minimize bandwidth and server load

● The server can send data to the client using JSON and the client's machine can render the data

● This saves bandwidth● Infrequently requested data can be served to the client on demand resulting in a decrease in the number of database queries executed

● This reduces the load on the server

Page 19: Download PPT

Launch PHP, JSON and AJAX Example

Page 20: Download PPT

Overview● What is JSON?● What is AJAX?● Why do PHP, JSON and AJAX make a great team?

● How can you prepare to implement PHP, JSON and AJAX into your web application?

Page 21: Download PPT

What you need to know to begin implementing these technologies

● Marking up a web page is very different from scripting a web page

● Developing AJAX applications requires a different skillset than traditional web applications

● Requires the developer to be fluent in PHP and JavaScript

Page 22: Download PPT

How do you put together a good team?● Find developers with strong skills in both PHP and JavaScript

● It will be hard to find developers with lots of experience with AJAX and JSON because they are relatively new technologies

● Look for developers that are eager to learn

Page 23: Download PPT

How can you equip your team to develop using these technologies?

● Give them time to research the topics using online resources

● Give them an existing problem to “fix” or “improve”

● Send a lead developer to a conference covering these topics... like this one

Page 24: Download PPT

Overview● What is JSON?● What is AJAX?● Why do PHP, JSON and AJAX make a great team?

● How can you prepare to implement PHP, JSON and AJAX into your web application?

Page 25: Download PPT

Resources● http://www.php.net● http://www.json.org● http://www.ajaxian.com/● http://pear.php.net/pepr/pepr-proposal-show.php?id=198

● http://www.aurore.net/projects/php-json/

Page 26: Download PPT

The End