OData for iOS developers


Published on

An overview of OData delivered at the Atlanta iOS meetup 3/15/2011

Published in: Technology
  • Be the first to comment

No Downloads
Total views
On SlideShare
From Embeds
Number of Embeds
Embeds 0
No embeds

No notes for slide
  • Representational State Transfer (REST) is defined as an architectural style, which means that it is not a concrete systems architecture, but instead a set of constraints that are applied when designing a systems architecture. We briefly discuss these constraints, but then focus on explaining how the Web is one such systems architecture that implements REST. In particular, the mechanisms of the Uniform Resource Identifiers (URIs), the Hypertext Transfer Protocol (HTTP), media types, and markup languages such as the Hypertext Markup Language (HTML) and the Extensible Markup Language (XML). We also introduce Atom and the Atom Publishing Protocol (AtomPub) as two established ways on how RESTful services are already provided and used on today's Web.
  • JSON (an acronym for JavaScript Object Notation) is a lightweight text-based open standard designed for human-readable data interchange. It is derived from the JavaScript programming language for representing simple data structures and associative arrays, called objects. Despite its relationship to JavaScript, it is language-independent, with parsers available for virtually every programming language.
  • OData for iOS developers

    1. 1. OData: A primer for iOS developers<br />Glen Gordon<br />Developer Evangelist<br />Microsoft Corporation<br />http://glengordon.name<br />@glengordon<br />
    2. 2. Who is this Microsoft guy?<br />I support developer communities in GA, AL, MS<br />I work with developers from all roles: enterprise, consultants, ISVs, students, startups, designers<br />Lots of ways to interface with something Microsoft related<br />.NET, PHP, JavaScript<br />Silverlight, Windows Phone, iOS<br />My goal is to make members of the community successful by introducing new technology or connecting people<br />
    3. 3. Agenda<br />The case for OData<br />A look at the format<br />Producers, services and consumers<br />Resources and tips<br />
    4. 4. why data services?<br />
    5. 5. break data silos<br />
    6. 6. == data sharing & integration<br />
    7. 7. Requirements for Web Data Services<br />Web friendly, just plain HTTP<br />Uniform patterns<br />Focus on data, not on formats<br />Stay high level, abstract the store<br />
    8. 8. data service != gateway to database<br />service interface<br />business logic<br />store<br />
    9. 9. odata in 1 slide…<br />
    10. 10. OData<br />Uniform way of representing structured data<br />Atom, JSON formats<br />Uniform URI conventions<br />Navigation, filtering, sorting, paging, etc.<br />Uniform operations<br />Addressability<br />GET, POST, PUT, DELETE always mean the same<br />
    11. 11. REST: 3 definitions<br />An architectural style for building loosely coupled systems <br />defined by a set of very general constraints (principles) <br />the Web (URI/HTTP/HTML/XML) is an instance of this style<br />The Web used correctly (i.e., not using the Web as transport) <br />HTTP is built according to RESTful principles <br />services are built on top of Web standards without misusing them <br />most importantly, HTTP is an application protocol (not a transport protocol)<br />Anything that uses HTTP and XML (XML without SOAP) <br />XML-RPC was the first approach for this <br />violates REST because there is no uniform interface<br />
    12. 12. The name Atom applies to a pair of related standards. The Atom Syndication Format is an XML language used for web feeds, while the Atom Publishing Protocol (AtomPub) is a simple HTTP-based protocol for creating and updating web resources.<br />ATOMPub<br />
    13. 13. http://services.odata.org/OData/OData.svc<br />_______________________________________/<br /> | <br /> service root URI<br />http://services.odata.org/OData/OData.svc/Category(1)/Products?$top=2&$orderby=name<br />_______________________________________/ __________________/ _________________/<br /> | | |<br /> service root URI resource path query options<br />What is a URI?<br />
    14. 14. Full SQL like Query “Language”<br />
    15. 15. Addressing entities and sets<br />
    16. 16. Presentation options<br />
    17. 17. Query Options<br />
    18. 18. Filter Expressions<br />
    19. 19. Filter Methods<br />
    20. 20. Examples<br />http://services.odata.org/OData.svc/GetProductsByRating?rating=5<br />Identifies the "GetProductsByRating" Service Operation and specifies a value of 5 for the "rating" input parameter.<br />Service Operations(Functions)<br />
    21. 21. { "d" : {<br /> "results": [<br /> {<br /> "__metadata": { <br /> "uri": "http://services.odata.org/OData/OData.svc/Categories(0)", <br /> "type": "DataServiceProviderDemo.Category"<br /> },<br /> "ID": 0,<br /> "Name": "Food",<br /> "Products": {<br /> "__deferred": {<br /> "uri": "http://services.odata.org/OData/OData.svc/Categories(0)/Products"<br /> }<br /> }<br /> }, <br /> { /* another Category Entry */ },<br /> { /* another Category Entry */ },<br /> { /* another Category Entry */ }<br /> ],<br /> "__count": "3",<br /> "__next": "http://services.odata.org/OData/OData.svc$skiptoken=12"<br />} }<br />JSON<br />
    22. 22. Producers and Consumers<br />
    23. 23. OData Producers<br />Windows Communication Foundation (WCF)<br />SharePoint 2010<br />IBM WebSphere<br />SQL Azure<br />Windows Azure Table Storage<br />SQL Server Reporting Services<br />Microsoft Dynamics CRM 2011<br />GeoREST<br />Build your own<br />
    24. 24. OData Services<br />ebay<br />Netflix<br />Twitpic<br />Windows Live<br />NerdDinner<br />Open Government Data Initiative<br />Open Science Data Initiative<br />Windows Azure Marketplace DataMarket<br />
    25. 25. OData Consumers – End Users<br />Web Browsers<br />Excel 2010<br />OData Explorer<br />
    26. 26. OData Consumers – Client Libraries<br />.NET<br />Javascript<br />PHP<br />Java<br />Windows Phone 7<br />iOS (Objective C)<br />Ruby<br />Joomla<br />Drupal<br />
    27. 27. Servers<br /><ul><li>WCF Data Services
    28. 28. SharePoint 2010
    29. 29. SQL Server Reporting Services 2008 R2
    30. 30. SQL Azure
    31. 31. IBM WebSphereeXtremeScale
    32. 32. Microsoft Media Room
    33. 33. WCF RIA Services</li></ul>Services<br /><ul><li>Netflix
    34. 34. Mix 2010
    35. 35. Nerd Dinner
    36. 36. Vancouver’s vanGuide
    37. 37. Open Government Data Initiative
    38. 38. Open Science Data Initiative
    39. 39. Microsoft Codename “Dallas”
    40. 40. City of Edmonton</li></ul>http://odata.org/producers<br />Clients<br /><ul><li>Excel + PowerPivot
    41. 41. LINQPad
    42. 42. OData Explorer</li></ul>Client libraries<br /><ul><li>.NET
    43. 43. Silverlight
    44. 44. Windows Phone 7 Series
    45. 45. Javascript
    46. 46. Java
    47. 47. Objective-C
    48. 48. PHP</li></ul>http://odata.org/consumers<br />
    49. 49. OData and iOS<br />
    50. 50. OData and iOS<br />http requests<br />Parse XML or JSON<br />OR<br />Use the OData Client for Objective-C<br />http://odataobjc.codeplex.com/<br />
    51. 51. demos<br />
    52. 52. Resources<br />All things OData: http://odata.org<br />Email: glen.gordon@microsoft.com<br />Blog: http://glengordon.name<br />Data @ MSDN: http://msdn.com/data<br />
    53. 53. © 2010 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are or may be registered trademarks and/or trademarks in the U.S. and/or other countries.<br />The information herein is for informational purposes only and represents the current view of Microsoft Corporation as of the date of this presentation. Because Microsoft must respond to changing market conditions, it should not be interpreted to be a commitment on the part of Microsoft, and Microsoft cannot guarantee the accuracy of any information provided after the date of this presentation. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION.<br />