Programming coldfusion with APIs

2,785 views

Published on

Programming coldfusion with APIs

Published in: Technology
0 Comments
3 Likes
Statistics
Notes
  • Be the first to comment

No Downloads
Views
Total views
2,785
On SlideShare
0
From Embeds
0
Number of Embeds
51
Actions
Shares
0
Downloads
0
Comments
0
Likes
3
Embeds 0
No embeds

No notes for slide

Programming coldfusion with APIs

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

×