OData feed for that - stldodn

Post on 27-Jan-2015

108 views 4 download

Tags:

description

Presentation delivered at the 2010 Day of .NET, August 20 & 21 at the Ameristar in St. Charles, MO

Transcript of OData feed for that - stldodn

Odata - “Make An App A Feed For That”

Chris Deweese, Consultant, Daugherty Business Solutions

Warning

• Should I answer my phone and suddenly run out, rest assured knowing it’s because my wife is most likely going into labor with our 3rd child.

• Its definitely not because I’m totally unprepared for this and have no idea what I’m talking about.

• Definitely not that.

This session• A Problem• What is OData?• Nuts & Bolts• Make a feed for that (.NET 4/VS

2010 - *bling*)

A Problem• Middle-Tier Data Access

Front-EndServers

Middle-TierServers

DatabaseServers

What is it?• Open Data Protocol• A protocol for working with

data via HTTP• Developed as protocol for

“Astoria”/ADO.Net Data Services

• V2 implemented in WCF Data Services

Intrigued. Continue.• Represent structured data

in a rich way• Supports multiple formats –

Xml, Json• Xml is based on Atom Pub• Currently released under

Microsoft’s Open Specification Promise

What you get• OData services provide a

Service Document that is all about Metadata

• Rich metadata allows consumers to understand data shape & types

• OData is modular; only implement the pieces you need

More Xml?• More than just spewing

Xml• OData is about making

data accessible and queryable using standard Http verbs & actions

• Don’t forget! OData supports JSON too (if you hate Xml that much)

Query over Http?• OData provides query

operators to sort & filter data via URIs

• $filter• $orderby• $skip, $top• … and there’s more• Producers implement query

operators around their data

Query? Over Http?• Ever tried to build a

“queryable” web service with SOAP?

• Bottom line: Ugly.• OData: Not-so-ugly

http://myblog.com/blog.svc/Posts?$filter=TagName%20eq$20‘WCF’

Why Http? • OData takes what works for the

web• Using Http as it was meant to be

used• Follows REST style philosophy –

uses URIs as resources• [OData team does not claim to

be ‘restful’]• Makes Data accessible to apps

via the most successful protocol in use – Http.

• Not another “SOAP”• ATOM, JSON - Easy integration

with Modern Languages & Frameworks

Terminology• Entity – Representation of data –

Blog Post, Product, Movie, etc.• Feed – A collection of entities

exposed through a service.• Producer – Services that exposes

data using OData feeds – Netflix, MIX10, NerdDinner

• Consumer – An application or framework that can consume OData feeds – Silverlight 4, PowerPivot, PHP*, Objective-C* [*=using OData SDK]

OData “Ecosystem”

Slide Credit: Session FT13 from MIX10

Clients• Excel + PowerPivot• LINQPad• OData Explorer

Client libraries• .NET• Silverlight• Windows Phone 7 Series• Javascript• Java• Objective-C• PHP

Servers• WCF Data Services• SharePoint 2010• SQL Server Reporting Services 2008 R2• SQL Azure• IBM WebSphere eXtreme Scale• Microsoft Media Room• WCF RIA Services

Services• Netflix• Mix 2010• Nerd Dinner• Vancouver’s vanGuide• Open Government Data Initiative• Open Science Data Initiative• Microsoft Codename “Dallas”• City of Edmonton

OData in the Wild

Slide Credit: Session FT13 from MIX10

Let’s Take a Peek• NUTS! (and bolts too)

Photo Credit: SashaW via Flickr

Feed for What?• Scott Hanselman’s

StackOverflow Challenge

• Using a recent dump of the SO Database, let’s build a feed for that

Read Scott’s post here: http://bit.ly/bq5WA9

Stuff We Didn’t Cover• Creating/Deleting Entities• Security (ASP.NET/Windows/NTLM)• Other Languages, JavaScript, PHP,

Etc.• Media Streaming/Content Delivery

support (WCF Data Services/IDataServiceStreamProvider)

• Lots of other things..

Take-a-ways• OData is a protocol for enabling

data-driven, web-based services• In .NET OData is implemented by

WCF Data Services using EF• Developers can take control of Entity

Access & Performance tuning of WCF Data Service (caching, paging)

• OData uses existing authentication & authorization schemes

• OData feeds can replace existing web APIs with a data-centric model

Discussion

Thanks!

• OData resources:• http://odata.org/• http://odataprimer.com• http://blogs.msdn.com/astoriateam

• Contact me:• http://christopherDeweese.com• @cdeweese on the Twitter