Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.
Gaining the Knowledge of the Open Data
Protocol (OData)
PRAIRIE DEVCON 2015
CHRIS WOODRUFF
Hi, I’m Woody!
• Chris Woodruff
• cwoodruff@live.com
• http://chriswoodruff.com
• http://deepfriedbytes.com
• twitter @cwo...
THE AGENDA
BACKGROUND
OF ODATA
UNDERSTANDING
ODATA
PROTOCOL
CONSUME ODATA
WITH
TESTING TOOLS
PRODUCE AN
ODATA FEED
USING R...
SURVEY
DATA
API
…are comfortable w/ HTTP and
XML? JSON?
…have created a Data API?
…knows what the web is?
…have a basic un...
BACKGROUND OF ODATA
ISSUE Data APIs frequently
create more problems than
solutions
Facebook: What fields
will I get when I read
a post?
Facebook: How do you like a
post?
HOW DO DEVELOPERS KNOW WHAT TO DO?
I GUESS THEY USE DOCS
SO IS THERE REALLY A PROBLEM?
CAN ODATA MAGICALLY CURE THE PROBLEM?
NO BUT IT CAN HELP!
UNDERSTANDING ODATA PROTOCOL
2007
PROJECT ASTORIA
2007
ADO.NET DATA SERVICES
2008
WCF DATA SERVICES
2013
ODATA PART OF WEB API
2012
ODATA V3 RELEASED
2014
ODATA v4 RELEASED
2015
RESTier FRAMEWORK
BASICS OF ODATA
1
Feeds, which are
Collections of typed
Entities
2
OData services can expose
Actions and Functions (v4)
3
...
CRUD
PUTGET
POST DELETE
SELECT
INSERT
UPDATE
FULL SQL LIKE QUERY “LANGUAGE”
DELETE
SERVICE METADATA DOCUMENT
CONVENTIONS
http://services.odata.org/OData/OData.svc
__________________________________/
|
service root URI
http://servic...
URL CONVENTIONS
$FILTER
/Suppliers?$filter=Address/City eq 'Redmond‘
01
$ORDERBY
/Products?$orderby=ReleaseDate asc, Ratin...
COMBINING URL CONVENTIONS
http://<something>.svc/Players/
?$skip=10
&$top=2
&filter=substringof(‘Wood',nameLast)
&$orderby...
PAYLOAD CONVENTIONS
SUCCESS AND ERROR CODES
200 OK, 201 Created, 415 Unsupported Media Type,
0
1
FORMATS
• JSON
• ATOM
• J...
JSON FORMAT
FRIENDLY TO JAVASCRIPT0
1
0
2
0
3
0
4
90% MORE COMPACT
READS LIKE A CUSTOM API
VERY LITTLE ODATA “GUNK”
ATOM FORMAT
ATOM PARSERS EXIST EVERYWHERE0
1
0
2
0
3
0
4
ELEMENT FIELDS MAP TO THEIR
ATOM COUNTERPARTS
GOOD EXAMPLE OF ODA...
OTHER ODATA CAPABILITIES
ACTIONS AND FUNCTIONS ALLOW
HYPERMEDIA-BASED METHODS
0
1
0
2
0
3
DEFINED CONVENTIONS FOR
PATCH AN...
WHAT NOT TO DO WITH ODATA
NOT A FIT FOR HIGHLY
OPINIONATED APIs
0
1
0
2
0
3
NOT GOOD FOR BULK DATA
TRANSFER
HARD TO BUILD ...
ODATA DOESN’T SUPPORT ALL QUERIES
DOESN’T SUPPORT AGGREGATION
You can’t ask for customers that have at
0
1
0
2
0
3
DOESN’T...
The OASIS international open standards consortium announced
the approval of the Open Data Protocol (OData) 4.0 and the
ODa...
WHO USES ODATA?
ANDROID
.NET
JAVA
PHPiOS
.NET
JAVA
WINDOWS PHONE
JAVASCRIPT
RUBY, PHP AND MANY
OTHERS
NODE.JS
MSSQL, MYSQL...
WHAT DOES ODATA GIVE ME AND MY ORGANIZATION?
EMPOWER INTERNAL KNOWLEDGE
WORKS
EMPOWER EXISTING OR FUTURE
COSTOMERS
MONITIZ...
CONSUME ODATA WITH TESTING TOOLS
XODATA
Web-based OData Visualizer
FIDDLER
Free web debugging tool which
logs all HTTP(S) traffic between
your computer and...
Demo
PRODUCE AN ODATA FEED USING RESTier
Demo
www.chriswoodruff.com Page Number 35
CONSUME ODATA WITH AN UNIVERSAL APP
Demo
TOMORROW @ 2:30PM ROOM D
BEST PRACTICES
ADVANCED TOPICS SHARE ODATA IN UNIVERSAL APP
VALIDATION
Learning How to Shape
and ...
GITHUB
http://github.com/cwoodruff
Projects:
ChinookOData
ChinookWebAPIOData
BaseballStatsODatav4RESTier
Where can you fin...
ODATA WORKSHOP
01
02
03
04
TESTING/DEBUGGING ODATA
DEVELPING CLIENT SIDE SOLUTIONS
• Web Apps using Javascript to consume ...
THANK YOU
Find me around the conference and would enjoy chatting
Email: cwoodruff@live.com
Twitter: @cwoodruff
Upcoming SlideShare
Loading in …5
×

Gaining the Knowledge of the Open Data Protocol (OData) - Prairie Dev Con

1,127 views

Published on

The Open Data Protocol (OData) is an open protocol for sharing data. It provides a way to break down data silos and increase the shared value of data by creating an ecosystem in which data consumers can interoperate with data producers in a way that is far more powerful than currently possible, enabling more applications to make sense of a broader set of data. Every producer and consumer of data that participates in this ecosystem increases its overall value.

OData is consistent with the way the Web works – it makes a deep commitment to URIs for resource identification and commits to an HTTP-based, uniform interface for interacting with those resources (just like the Web). This commitment to core Web principles allows OData to enable a new level of data integration and interoperability across a broad range of clients, servers, services, and tools.

Published in: Technology
  • Be the first to comment

  • Be the first to like this

Gaining the Knowledge of the Open Data Protocol (OData) - Prairie Dev Con

  1. 1. Gaining the Knowledge of the Open Data Protocol (OData) PRAIRIE DEVCON 2015 CHRIS WOODRUFF
  2. 2. Hi, I’m Woody! • Chris Woodruff • cwoodruff@live.com • http://chriswoodruff.com • http://deepfriedbytes.com • twitter @cwoodruff
  3. 3. THE AGENDA BACKGROUND OF ODATA UNDERSTANDING ODATA PROTOCOL CONSUME ODATA WITH TESTING TOOLS PRODUCE AN ODATA FEED USING RESTier CONSUME ODATA WITH AN UNIVERSAL APP
  4. 4. SURVEY DATA API …are comfortable w/ HTTP and XML? JSON? …have created a Data API? …knows what the web is? …have a basic understanding of the term REST?
  5. 5. BACKGROUND OF ODATA
  6. 6. ISSUE Data APIs frequently create more problems than solutions
  7. 7. Facebook: What fields will I get when I read a post?
  8. 8. Facebook: How do you like a post?
  9. 9. HOW DO DEVELOPERS KNOW WHAT TO DO?
  10. 10. I GUESS THEY USE DOCS
  11. 11. SO IS THERE REALLY A PROBLEM?
  12. 12. CAN ODATA MAGICALLY CURE THE PROBLEM? NO BUT IT CAN HELP!
  13. 13. UNDERSTANDING ODATA PROTOCOL
  14. 14. 2007 PROJECT ASTORIA 2007 ADO.NET DATA SERVICES 2008 WCF DATA SERVICES 2013 ODATA PART OF WEB API
  15. 15. 2012 ODATA V3 RELEASED 2014 ODATA v4 RELEASED 2015 RESTier FRAMEWORK
  16. 16. BASICS OF ODATA 1 Feeds, which are Collections of typed Entities 2 OData services can expose Actions and Functions (v4) 3 OData services expose all these constructs via URIs 4 OData service may also expose a Service Metadata Document
  17. 17. CRUD PUTGET POST DELETE SELECT INSERT UPDATE FULL SQL LIKE QUERY “LANGUAGE” DELETE
  18. 18. SERVICE METADATA DOCUMENT
  19. 19. CONVENTIONS http://services.odata.org/OData/OData.svc __________________________________/ | service root URI http://services.odata.org/OData/OData.svc/Category(1)/Products?$top=2&$orderby=name __________________________________/ ________________/ __________________/ | | | service root URI resource path query options
  20. 20. URL CONVENTIONS $FILTER /Suppliers?$filter=Address/City eq 'Redmond‘ 01 $ORDERBY /Products?$orderby=ReleaseDate asc, Rating desc 02 $SELECT /Products?$select=*,Category/Name 03 $EXPAND /Products?$select=*,Category/Name&$expand=Category 04 $TOP $SKIP /Products?$top=5&$skip=2 05
  21. 21. COMBINING URL CONVENTIONS http://<something>.svc/Players/ ?$skip=10 &$top=2 &filter=substringof(‘Wood',nameLast) &$orderby=nameLast%20desc &$select=nickname,yearBorn,nameFirst, nameLast &$format=json
  22. 22. PAYLOAD CONVENTIONS SUCCESS AND ERROR CODES 200 OK, 201 Created, 415 Unsupported Media Type, 0 1 FORMATS • JSON • ATOM • JSON VERBOSE 0 2 NUANCES PATCH, Null payloads, etc 0 3
  23. 23. JSON FORMAT FRIENDLY TO JAVASCRIPT0 1 0 2 0 3 0 4 90% MORE COMPACT READS LIKE A CUSTOM API VERY LITTLE ODATA “GUNK”
  24. 24. ATOM FORMAT ATOM PARSERS EXIST EVERYWHERE0 1 0 2 0 3 0 4 ELEMENT FIELDS MAP TO THEIR ATOM COUNTERPARTS GOOD EXAMPLE OF ODATA INTEROPERABILITY CAN USE LIKE XML
  25. 25. OTHER ODATA CAPABILITIES ACTIONS AND FUNCTIONS ALLOW HYPERMEDIA-BASED METHODS 0 1 0 2 0 3 DEFINED CONVENTIONS FOR PATCH AND DEEP INSERTS VOCABULARIES
  26. 26. WHAT NOT TO DO WITH ODATA NOT A FIT FOR HIGHLY OPINIONATED APIs 0 1 0 2 0 3 NOT GOOD FOR BULK DATA TRANSFER HARD TO BUILD APIs THAT ARE RADICALLY DIFFERENT THAN BACKEND
  27. 27. ODATA DOESN’T SUPPORT ALL QUERIES DOESN’T SUPPORT AGGREGATION You can’t ask for customers that have at 0 1 0 2 0 3 DOESN’T SUPPORT FILTER EXPANSION You can’t ask for a customer and only their orders placed in 2013 DOESN’T SUPPORT “GRAPH” QUERIES You can ask friend-of-a-friend type queries, but there are limitations
  28. 28. The OASIS international open standards consortium announced the approval of the Open Data Protocol (OData) 4.0 and the OData JSON Format 4.0. These REST-based standards simplify the querying and sharing of data across applications for re-use in the enterprise, cloud, and mobile devices. With OData, information can be accessed from a variety of sources including relational databases, file systems, content management systems, and traditional web sites. OData 4.0 and the OData JSON Format 4.0 are now official OASIS Standards, a status that signifies the highest level of ratification. RATIFIED MARCH 2014!! THERE ARE MANY NON-MICROSOFT PEOPLE ON THE TC!! ODATA IS A STANDARD!!
  29. 29. WHO USES ODATA? ANDROID .NET JAVA PHPiOS .NET JAVA WINDOWS PHONE JAVASCRIPT RUBY, PHP AND MANY OTHERS NODE.JS MSSQL, MYSQL, DB2, INFORMIX, AZUE SQL WINDOWS AZURE, SALESFORCE, SAP, MS CRM JOOMLA, DRUPAL, GEOREST
  30. 30. WHAT DOES ODATA GIVE ME AND MY ORGANIZATION? EMPOWER INTERNAL KNOWLEDGE WORKS EMPOWER EXISTING OR FUTURE COSTOMERS MONITIZE DATA FOR UNTAPPED REVENUE
  31. 31. CONSUME ODATA WITH TESTING TOOLS
  32. 32. XODATA Web-based OData Visualizer FIDDLER Free web debugging tool which logs all HTTP(S) traffic between your computer and the Internet. LINQPAD (v3) Interactively query SQL databases (among other data sources such as OData or WCF Data Services) using LINQ, as well as interactively writing C# code without the need for an IDE. ODATA VALIDATOR Enable OData service authors to validate their implementation against the OData specification to ensure the service interoperates well with any OData client. TESTING/DEBUGGING ODATA www.websitename.comwww.chriswoodruff.com Page Number 32
  33. 33. Demo
  34. 34. PRODUCE AN ODATA FEED USING RESTier
  35. 35. Demo www.chriswoodruff.com Page Number 35
  36. 36. CONSUME ODATA WITH AN UNIVERSAL APP
  37. 37. Demo
  38. 38. TOMORROW @ 2:30PM ROOM D BEST PRACTICES ADVANCED TOPICS SHARE ODATA IN UNIVERSAL APP VALIDATION Learning How to Shape and Configure an OData Feed for High Performing Web Sites and Applications
  39. 39. GITHUB http://github.com/cwoodruff Projects: ChinookOData ChinookWebAPIOData BaseballStatsODatav4RESTier Where can you find the source for this talk?
  40. 40. ODATA WORKSHOP 01 02 03 04 TESTING/DEBUGGING ODATA DEVELPING CLIENT SIDE SOLUTIONS • Web Apps using Javascript to consume Odata • iOS Swift development for native iPhone and iPad apps • Windows 8.1 and Windows Phone apps C# and WinJS • Android development using Java • Using Xamarin for consuming OData LEARNING THE PROTOCOL • The Metadata and Service Model of OData • URI Conventions of OData • Format Conventions of OData • OData HTTP Conventions and Operations DEVELPING SERVER SIDE SOLUTIONS • ASP.NET Web API • Advanced Performance Tips and Best Practices Go to http://ChrisWoodruff.com for more details and pricing
  41. 41. THANK YOU Find me around the conference and would enjoy chatting Email: cwoodruff@live.com Twitter: @cwoodruff

×