Introduction to o data
-
Upload
venkatesh-narayanan -
Category
Documents
-
view
88 -
download
0
Transcript of Introduction to o data
![Page 1: Introduction to o data](https://reader034.fdocuments.in/reader034/viewer/2022042700/559b501a1a28ab27448b45c0/html5/thumbnails/1.jpg)
INTRODUCTION TO ODATA
![Page 2: Introduction to o data](https://reader034.fdocuments.in/reader034/viewer/2022042700/559b501a1a28ab27448b45c0/html5/thumbnails/2.jpg)
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 o data](https://reader034.fdocuments.in/reader034/viewer/2022042700/559b501a1a28ab27448b45c0/html5/thumbnails/3.jpg)
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 o data](https://reader034.fdocuments.in/reader034/viewer/2022042700/559b501a1a28ab27448b45c0/html5/thumbnails/4.jpg)
ODATA ORG
![Page 5: Introduction to o data](https://reader034.fdocuments.in/reader034/viewer/2022042700/559b501a1a28ab27448b45c0/html5/thumbnails/5.jpg)
ATOM PROTOCOL
OData is layer on top of Atom Publishing
Protocol.
Atom is simple way of exposing ‘feed’ of
data.
![Page 6: Introduction to o data](https://reader034.fdocuments.in/reader034/viewer/2022042700/559b501a1a28ab27448b45c0/html5/thumbnails/6.jpg)
ODATA COMPONENTS
A Service definition language
Error handling
Dataset paging
Advanced Queries
Batch requests
Two request response formats : Atompub &
JSON
![Page 7: Introduction to o data](https://reader034.fdocuments.in/reader034/viewer/2022042700/559b501a1a28ab27448b45c0/html5/thumbnails/7.jpg)
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 o data](https://reader034.fdocuments.in/reader034/viewer/2022042700/559b501a1a28ab27448b45c0/html5/thumbnails/8.jpg)
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 o data](https://reader034.fdocuments.in/reader034/viewer/2022042700/559b501a1a28ab27448b45c0/html5/thumbnails/9.jpg)
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 o data](https://reader034.fdocuments.in/reader034/viewer/2022042700/559b501a1a28ab27448b45c0/html5/thumbnails/10.jpg)
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 o data](https://reader034.fdocuments.in/reader034/viewer/2022042700/559b501a1a28ab27448b45c0/html5/thumbnails/11.jpg)
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)/Suppl
ier/Address/City
http://services.odata.org/OData/OData.svc/Categories(1)/Products(1)/Suppl
ier/Address/City/$value
http://services.odata.org/OData/OData.svc/Categories(1)/$links/Products
![Page 12: Introduction to o data](https://reader034.fdocuments.in/reader034/viewer/2022042700/559b501a1a28ab27448b45c0/html5/thumbnails/12.jpg)
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/G
etProductsByRating?rating=4
![Page 13: Introduction to o data](https://reader034.fdocuments.in/reader034/viewer/2022042700/559b501a1a28ab27448b45c0/html5/thumbnails/13.jpg)
QUERY STRING OPTIONS
System Query Options ($orderby, $top,
$skip, $filter, $select)
Expand query option ($expand). Eager
Loading
http://services.odata.org/OData/OData.svc/C
ategories?$expand=Products
http://services.odata.org/OData/OData.svc/Pr
oducts?$select=Price,Name
![Page 14: Introduction to o data](https://reader034.fdocuments.in/reader034/viewer/2022042700/559b501a1a28ab27448b45c0/html5/thumbnails/14.jpg)
ODATA OPERATIONS
![Page 15: Introduction to o data](https://reader034.fdocuments.in/reader034/viewer/2022042700/559b501a1a28ab27448b45c0/html5/thumbnails/15.jpg)
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 o data](https://reader034.fdocuments.in/reader034/viewer/2022042700/559b501a1a28ab27448b45c0/html5/thumbnails/16.jpg)
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 o data](https://reader034.fdocuments.in/reader034/viewer/2022042700/559b501a1a28ab27448b45c0/html5/thumbnails/17.jpg)
SERVER PAGING
![Page 18: Introduction to o data](https://reader034.fdocuments.in/reader034/viewer/2022042700/559b501a1a28ab27448b45c0/html5/thumbnails/18.jpg)
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 o data](https://reader034.fdocuments.in/reader034/viewer/2022042700/559b501a1a28ab27448b45c0/html5/thumbnails/19.jpg)
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 o data](https://reader034.fdocuments.in/reader034/viewer/2022042700/559b501a1a28ab27448b45c0/html5/thumbnails/20.jpg)
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 o data](https://reader034.fdocuments.in/reader034/viewer/2022042700/559b501a1a28ab27448b45c0/html5/thumbnails/21.jpg)
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 o data](https://reader034.fdocuments.in/reader034/viewer/2022042700/559b501a1a28ab27448b45c0/html5/thumbnails/22.jpg)
REFERENCES
http://www.odata.org
http://www.odataprimer.com