+ All Categories
Home > Documents > Introduction to OData

Introduction to OData

Date post: 10-Apr-2015
Category:
Upload: venkatesh-narayanan
View: 1,039 times
Download: 3 times
Share this document with a friend
22
INTRODUCTION TO ODATA
Transcript
Page 1: Introduction to OData

INTRODUCTION TO ODATA

Page 2: Introduction to OData

WHAT IS ODATA

A web protocol for querying and updating data.

Built on top of technologies like http, AtomPub

and JSON.

Enables a standardized way for data to be

available over the web.

OData is RESTful service style as SOAP is to

RPC.

Page 3: Introduction to OData

ODATA : UNIFORMITY

Uniform way of representing structured data

– JSON & XML

Uniform URL Conventions

– Navigation, Filtering, Sorting, Paging

Uniform Operations

– GET, POST, PUT DELETE always mean the same

Page 4: Introduction to OData

ODATA ORG

Page 5: Introduction to OData

ATOM PROTOCOL

OData is layer on top of Atom Publishing

Protocol.

Atom is simple way of exposing ‘feed’ of data.

Page 6: Introduction to OData

ODATA COMPONENTS

A Service definition language

Error handling

Dataset paging

Advanced Queries

Batch requests

Two request response formats : Atompub &

JSON

Page 7: Introduction to OData

ODATA BASICS

OData is composed of feeds, which are

collections of typed entries.

Each entry represents a structured record with

a key.

Entries can be part of type hierarchy

Example :

http://services.odata.org/OData/OData.svc/Pr

oducts

Page 8: Introduction to OData

SERVICE DOCUMENT

OData service may contain one or more feeds.

Service document lists all top level feeds.

Sample Service Document :

http://services.odata.org/OData/OData.svc

OData service can expose service specific

operations

Page 9: Introduction to OData

SERVICE META DOCUMENT

Service meta document describes the shape of an OData service.

Describes the Entity Data Model (EDM) of a given service.

Abstract data model of the resources exposed by the service.

Sample Meta Document : http://services.odata.org/OData/OData.svc/$metadata

Page 10: Introduction to OData

ENTITY DATA MODEL

EDM is the abstract data model used by the

OData Services.

EDM is independent of underlying data

persistence format or implementation.

Entities and Associations are main concepts in

EDM.

Page 11: Introduction to OData

URI COMPONENTS

http://services.odata.org/OData/OData.svc/Categories

http://services.odata.org/OData/OData.svc/Categories(1)

http://services.odata.org/OData/OData.svc/Categories(1)/Name

http://services.odata.org/OData/OData.svc/Categories(1)/Products

http://services.odata.org/OData/OData.svc/Categories(1)/Products/$count

http://services.odata.org/OData/OData.svc/Categories(1)/Products(1)/Supplie

r/Address/City

http://services.odata.org/OData/OData.svc/Categories(1)/Products(1)/Supplie

r/Address/City/$value

http://services.odata.org/OData/OData.svc/Categories(1)/$links/Products

Page 12: Introduction to OData

SERVICE OPERATIONS

OData services can expose service operations,

which are simple functions.

A service operation can accept primitive type

input parameters.

Can be defined to return a single or collection

of primitive, complex type, entries or void.

http://services.odata.org/OData/OData.svc/Pr

oductsByColor?color=%27red%27

Page 13: Introduction to OData

QUERY STRING OPTIONS

System Query Options ($orderby, $top, $skip,

$filter, $select)

Expand query option ($expand). Eager Loading

http://services.odata.org/OData/OData.svc/Ca

tegories?$expand=Products

http://services.odata.org/OData/OData.svc/Pr

oducts?$select=Price,Name

Page 14: Introduction to OData

ODATA OPERATIONS

Page 15: Introduction to OData

WCF DATA SERVICE

WCF Data services enables the creation and

consumption of OData services for the web.

Demo with VS2010, ADO.NET Entity Model,

Northwind DB and WCF Data Service.

Page 16: Introduction to OData

SERVER PAGING IN DATA SERVICES

Allow the service author to limit the size of

response to a query.

For queries that exceeds size limit:

Partial response is returned without exceeding the

size limit.

In addition a link to get the rest of the results.

Page 17: Introduction to OData

SERVER PAGING

Page 18: Introduction to OData

SHAREPOINT & ODATA

Every Sharepoint 2010 server is Data Services

server.

Supports ATOM & JSON formats.

Enables client integration with sharepoint from

any platform & any language.

Page 19: Introduction to OData

CUSTOM DATA SERVICE PROVIDER

Data services sits on top of Data service

provider.

Entity Framework

LINQ to SQL DataContext

Custom Service Provider – IDataService

Metadata, Query, Update, Paging, Stream

Provider

For more details on custom DSP see here

Page 20: Introduction to OData

GDATA

Google has GData protocol for accessing

Calendar, Youtube.

Limited only to Google Services.

OData is an attempt to open up server side of

the protocol.

Page 21: Introduction to OData

CONCLUSION

Simple, Uniform way of sharing data at the

protocol level.

Enables broad integration across products and

breaks data silos.

All you need is Http stack to integrate with any

OData producer.

Sharepoint and Office betting on OData.

Page 22: Introduction to OData

REFERENCES

http://www.odata.org

http://www.odataprimer.com


Recommended