Md. Kamrul Hasan
Sr. Software Engineer & Instructor
https://bd.linkedin.com/in/kamrul-hasan-29361224
OData Fundamental
Agenda
 What is OData?
 Why OData?
 OData Resource identification.
 OData Resource operation.
 OData Resource representation.
 OData Query Option Parameters.
 Tools & Libraries
 Demo
 A standard API for Data Access
 Best way to REST.
 Queryable and interoperable RESTful APIs.
 OASIS-approved industry standard.
 Uniform way to describe both data and the
data model.
What is OData?
Why OData why not RESTful Services.
 REST is an architectural style, but it is
not a standard.
 It leaves few design decisions open to
us.
 How should we name our resources?
 How should we support paging?
 What about data shaping or querying data?
 Which status code should be returned?
 Well this is where OData comes into the
picture.
OData Resource Identification.
http://services.odata.org/v4/OData/OData.svc/Products/$count
service root URI resource
path
query
options
(optional)
Entity-set /Products
SingleEntry /Products(1)
MemberAccess /Products(1)/Price
LinkTraversal /Categories(2)/Products
URI Format:
JSON:
http://services.odata.org/v4/OData/OData.svc/Products?$format=json
Atom:
OData Resource operation.
 GET
 POST
 PUT
 PATCH
 DELETE
OData Resource representation.
 OData uses different formats for
representing data and the data model.
 Data: JSON, Atom(xml)
http://services.odata.org/v4/OData/OData.svc/Products
 Data Model: CSDL (Common Schema
Definition Language)
http://services.odata.org/v4/OData/OData.svc/$metadata
OData Query Option Parameters.
All Product
http://services.odata.org/v4/OData/OData.svc/Products
Product By Key
http://services.odata.org/v4/OData/OData.svc/Products(1)
More Filter
..OData.svc/Products?$orderby=Rating
..OData.svc/Products?$top=5
..OData.svc/Products/?$filter=Price lt 100
..OData.svc/Categories(1)/Products(1)/Supplier/Address/City
Tools & Libraries
 RESTier provides facilities to bootstrap an OData service
like what WCF Data Services (which is sunset) does.
 XOData is a generic OData API/Service visualizer and
explorer.
Demo
https://github.com/EhanAreesha/ODataFundamental
Thanks
11/14/2016

OData Fundamental

  • 1.
    Md. Kamrul Hasan Sr.Software Engineer & Instructor https://bd.linkedin.com/in/kamrul-hasan-29361224 OData Fundamental
  • 2.
    Agenda  What isOData?  Why OData?  OData Resource identification.  OData Resource operation.  OData Resource representation.  OData Query Option Parameters.  Tools & Libraries  Demo
  • 3.
     A standardAPI for Data Access  Best way to REST.  Queryable and interoperable RESTful APIs.  OASIS-approved industry standard.  Uniform way to describe both data and the data model. What is OData?
  • 4.
    Why OData whynot RESTful Services.  REST is an architectural style, but it is not a standard.  It leaves few design decisions open to us.  How should we name our resources?  How should we support paging?  What about data shaping or querying data?  Which status code should be returned?  Well this is where OData comes into the picture.
  • 5.
    OData Resource Identification. http://services.odata.org/v4/OData/OData.svc/Products/$count serviceroot URI resource path query options (optional) Entity-set /Products SingleEntry /Products(1) MemberAccess /Products(1)/Price LinkTraversal /Categories(2)/Products URI Format: JSON: http://services.odata.org/v4/OData/OData.svc/Products?$format=json Atom:
  • 6.
    OData Resource operation. GET  POST  PUT  PATCH  DELETE
  • 7.
    OData Resource representation. OData uses different formats for representing data and the data model.  Data: JSON, Atom(xml) http://services.odata.org/v4/OData/OData.svc/Products  Data Model: CSDL (Common Schema Definition Language) http://services.odata.org/v4/OData/OData.svc/$metadata
  • 8.
    OData Query OptionParameters. All Product http://services.odata.org/v4/OData/OData.svc/Products Product By Key http://services.odata.org/v4/OData/OData.svc/Products(1) More Filter ..OData.svc/Products?$orderby=Rating ..OData.svc/Products?$top=5 ..OData.svc/Products/?$filter=Price lt 100 ..OData.svc/Categories(1)/Products(1)/Supplier/Address/City
  • 9.
    Tools & Libraries RESTier provides facilities to bootstrap an OData service like what WCF Data Services (which is sunset) does.  XOData is a generic OData API/Service visualizer and explorer.
  • 10.

Editor's Notes

  • #3 Tip: Add your own speaker notes here.
  • #5 Tip: Add your own speaker notes here.
  • #9 Tip: Add your own speaker notes here.