KEMBAR78
Programming coldfusion with APIs | PPT
Programming with APIs Nick Tong http://TalkWebSolutions.co.uk http://succor.co.uk  Creative Commons Attribution ShareAlike 2.5
Agenda Who the hell is this guy? What are APIs? So what? Mash ups Connecting to APIs Examples of APIs Reliability Where is this all heading?
Who the hell are you? CF developer for 7 years Blogger for over 1 year Wanna be extreme dude…  You decide!
 
API? Abbreviation of  A pplication  P rogram  I nterface , a set of  routines ,  protocols , and tools for building  software applications . A good API makes it easier to develop a  program  by providing all the building blocks. A  programmer  simply puts the blocks together. APIs define the complete methods by which a programmer can access and control a given system.
So what! The Web of documents has morphed into a Web of data. We are no longer just looking to the same old sources for information. Now we’re looking to a new set of tools to aggregate and remix microcontent in new and useful ways. http://www.digital-web.com/articles/web_2_for_designers/
Ben Forsaith
Why is this a good idea? Application
Application B Application C Application A
Application A Application C Application B
Allows rule implementation Fix problems easier Improve scalability
 
Working with APIs Take data (or content) aka INFORMATION from one or several locations and present them as you see fit! What does this bring? Separation of concerns  Information Vs Layout http://flickr.com/photos/b4r7/14001542/
http://www.programmableweb.com
Some examples
Some examples cont…
Some examples cont… http://flickr.com/photos/gisuser/62266454/ Alertdude Google Mashup maps Florida sexual offenders
 
Why not? Associate ID required  Non Commercial use Non competition clause Plus others Take the BBC for example, we pay for it then we’re are only allowed to use a restricted subset!
How do we get the data? Web services REST ( RE presentational  S tate  T ransfer) SOAP ( S imple  O bject  A ccess  P rotocol)  XML-RPC JSON Flash Remoting
REST vs SOAP REST   Messages are represented in plain XML  HTTP is used for the transfer protocol  HTTP verbs are used for access/manipulation commands  URIs are used to uniquely identify resources in message  HTTP authentication provides security  There is no formal method for expressing the interface contract  SOAP   Messages are represented in a standardized XML SOAP "envelope"  Can be bound to various protocols including HTTP and SMTP  Access to and manipulation of data are application specific  Security is not described by SOAP and is to be provided by the developer  XML schemas are used to define the contract between client and service  http://res.sys-con.com/story/apr05/79282/fig1.jpg http://res.sys-con.com/story/apr05/79282/fig2.jpg
http://res.sys-con.com/story/apr05/79282/table1.jpg
I’m A  RESTafarian  http://flickr.com/photos/pantagrapher/17089865/
Okay show me the good stuff! Lets look as some code: Simple Example Yahoo APIs
But what about reliability? Use Meta APIs i.e. Mapstraction Cache data – only call new data if its required Their success is through your success
Sum things up already! APIs are a great way to make content available to multiple applications  Upgrades and saleability to be more manageable Separation of concerns Rapid development Grows applications  Makes large site possible Exciting via mash ups Fun
One last thing   Microformats Microformat types People and Organizations hCard Calendars and Events hCalendar Opinions, Ratings and Reviews VoteLinks ,  hReview Tags, Keywords, Categories rel-tag Lists and Outlines XOXO Social Networks XFN Licenses: rel-license What are microformats? D esigned for humans first and machines second,  microformats are a set of simple, open data formats  built upon existing and widely adopted standards.
Credits Thanks to  Simon Willison Paul Hammond Aral Balkan http://www.programmableweb.com http://res.sys-con.com   Creative Commons Attribution ShareAlike 2.5
Questions? [email_address] http://succor.co.uk http://talkwebsolutions.co.uk Projects http://cfFrameworks.com  – Coldfusion frameworks information site. http://wapurl.co.uk  – short mobile urls

Programming coldfusion with APIs

  • 1.
    Programming with APIsNick Tong http://TalkWebSolutions.co.uk http://succor.co.uk Creative Commons Attribution ShareAlike 2.5
  • 2.
    Agenda Who thehell is this guy? What are APIs? So what? Mash ups Connecting to APIs Examples of APIs Reliability Where is this all heading?
  • 3.
    Who the hellare you? CF developer for 7 years Blogger for over 1 year Wanna be extreme dude… You decide!
  • 4.
  • 5.
    API? Abbreviation of A pplication P rogram I nterface , a set of routines , protocols , and tools for building software applications . A good API makes it easier to develop a program by providing all the building blocks. A programmer simply puts the blocks together. APIs define the complete methods by which a programmer can access and control a given system.
  • 6.
    So what! TheWeb of documents has morphed into a Web of data. We are no longer just looking to the same old sources for information. Now we’re looking to a new set of tools to aggregate and remix microcontent in new and useful ways. http://www.digital-web.com/articles/web_2_for_designers/
  • 7.
  • 8.
    Why is thisa good idea? Application
  • 9.
  • 10.
  • 11.
    Allows rule implementationFix problems easier Improve scalability
  • 12.
  • 13.
    Working with APIsTake data (or content) aka INFORMATION from one or several locations and present them as you see fit! What does this bring? Separation of concerns Information Vs Layout http://flickr.com/photos/b4r7/14001542/
  • 14.
  • 15.
  • 16.
  • 17.
    Some examples cont…http://flickr.com/photos/gisuser/62266454/ Alertdude Google Mashup maps Florida sexual offenders
  • 18.
  • 19.
    Why not? AssociateID required Non Commercial use Non competition clause Plus others Take the BBC for example, we pay for it then we’re are only allowed to use a restricted subset!
  • 20.
    How do weget the data? Web services REST ( RE presentational S tate T ransfer) SOAP ( S imple O bject A ccess P rotocol) XML-RPC JSON Flash Remoting
  • 21.
    REST vs SOAPREST Messages are represented in plain XML HTTP is used for the transfer protocol HTTP verbs are used for access/manipulation commands URIs are used to uniquely identify resources in message HTTP authentication provides security There is no formal method for expressing the interface contract SOAP Messages are represented in a standardized XML SOAP "envelope" Can be bound to various protocols including HTTP and SMTP Access to and manipulation of data are application specific Security is not described by SOAP and is to be provided by the developer XML schemas are used to define the contract between client and service http://res.sys-con.com/story/apr05/79282/fig1.jpg http://res.sys-con.com/story/apr05/79282/fig2.jpg
  • 22.
  • 23.
    I’m A RESTafarian http://flickr.com/photos/pantagrapher/17089865/
  • 24.
    Okay show methe good stuff! Lets look as some code: Simple Example Yahoo APIs
  • 25.
    But what aboutreliability? Use Meta APIs i.e. Mapstraction Cache data – only call new data if its required Their success is through your success
  • 26.
    Sum things upalready! APIs are a great way to make content available to multiple applications Upgrades and saleability to be more manageable Separation of concerns Rapid development Grows applications Makes large site possible Exciting via mash ups Fun
  • 27.
    One last thing Microformats Microformat types People and Organizations hCard Calendars and Events hCalendar Opinions, Ratings and Reviews VoteLinks , hReview Tags, Keywords, Categories rel-tag Lists and Outlines XOXO Social Networks XFN Licenses: rel-license What are microformats? D esigned for humans first and machines second, microformats are a set of simple, open data formats built upon existing and widely adopted standards.
  • 28.
    Credits Thanks to Simon Willison Paul Hammond Aral Balkan http://www.programmableweb.com http://res.sys-con.com Creative Commons Attribution ShareAlike 2.5
  • 29.
    Questions? [email_address] http://succor.co.ukhttp://talkwebsolutions.co.uk Projects http://cfFrameworks.com – Coldfusion frameworks information site. http://wapurl.co.uk – short mobile urls