OData feed for that - stldodn

21
Odata - “Make An App A Feed For That” Chris Deweese, Consultant, Daugherty Business Solutions

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

Page 1: OData   feed for that - stldodn

Odata - “Make An App A Feed For That”

Chris Deweese, Consultant, Daugherty Business Solutions

Page 2: OData   feed for that - stldodn
Page 3: OData   feed for that - stldodn

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.

Page 4: OData   feed for that - stldodn

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

2010 - *bling*)

Page 5: OData   feed for that - stldodn

A Problem• Middle-Tier Data Access

Front-EndServers

Middle-TierServers

DatabaseServers

Page 6: OData   feed for that - stldodn

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

Page 7: OData   feed for that - stldodn

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

Page 8: OData   feed for that - stldodn

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

Page 9: OData   feed for that - stldodn

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)

Page 10: OData   feed for that - stldodn

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

Page 11: OData   feed for that - stldodn

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’

Page 12: OData   feed for that - stldodn

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

Page 13: OData   feed for that - stldodn

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]

Page 14: OData   feed for that - stldodn

OData “Ecosystem”

Slide Credit: Session FT13 from MIX10

Page 15: OData   feed for that - stldodn

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

Page 16: OData   feed for that - stldodn

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

Photo Credit: SashaW via Flickr

Page 17: OData   feed for that - stldodn

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

Page 18: OData   feed for that - stldodn

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..

Page 19: OData   feed for that - stldodn

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

Page 20: OData   feed for that - stldodn

Discussion

Page 21: OData   feed for that - stldodn

Thanks!

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

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