Upload
stephan-klevenz
View
703
Download
14
Embed Size (px)
DESCRIPTION
Citation preview
APACHE OLINGOOASIS OData - Client and Server
Stephan Klevenz, ApacheCon 2014 Denver
AGENDA• Part I
• OData Protocol • Overview • OASIS
• Part II • Play with OData • Demos
• Basic Processor • Annotation Processor • JPA Processor
PART I
ODATA PROTOCOL OVERVIEW
OData stands for Open Data Protocol (http://www.odata.org)
• is based on REST principles • supports JSON and AtomPub data formats
• Implementations available in • .NET, Java, JavaScript, Ruby, PHP and ObjectiveC
Binary API doesn’t work over the Internet (ODBC, ADO.NET, JDBC…) !Internet is HTTP! !HTTP + SQL !OData as the SQL for the Web
RDBMS
Data
Files
Data
XML
Data
NoSQL
Data
SQL API Parser API Query API
Applications
OData
http
UNLOCK DATA SILOS
ODATA PROTOCOL
RESTHTTPGETPUT…
DELETE
ATOMJSON
Server
Producer
Client
Consumer
.NET, Java, Ruby, PHP …
.NET, iOS, JavaScript, Java, Ruby
Excel, Tableau, LINQPad, PowerShel, OData Explorer
Azure, MySQL, AppEngine, SAP, IBM, Oracle
Project Astoria(Microsoft internal)
ADO.NET Data Services(Microsoft)
WCF Data Services(Microsoft)
OData 2.0(Microsoft Open
Specification Promisse)
OData 3.0(public)
OData 4.0(OASIS TC)
STRUCTURE OF ODATA
ArchitectureREST
ProtocolHTTP
Data Formats(Serialization)
AtomPubJSON
MetadataCSDL
(Conceptual Data Definition Language)
Data as ResourcesGET, PUT … DELETE
Cache, Proxies URIAddressable Data
Flexible Syntax
Entity Data Model (Chen’s 1976)Entities == ResourcesAssociations == Links
CRUD Create, Read, Update, DeleteGET - Read Resource
POST - Create ResourcePUT - Change Resource
DELETE - Delete Resource
ENTITY DATA MODEL (EDM)Entity Container
Entity Set
Entity
Property Property
Entity
Property Property
Entity Set
Entity
Property Property
Entity
Property NavigationProperty
Entity
Property NavigationProperty
Association
Association
METADATA DOCUMENT
OData Resource Is Described in an Entity Data Model by
Collection• Entity Set • A navigation property on an entity type that identifies a collection of
entities •
Entry • Entity Type • Note: Entity Types may be part of a type hierarchy
Property of an entry • Primitive or Complex Entity Type Property
Complex Type • Complex Type
Link • A Navigation Property defined on an Entity Type
Service Operation • Function Import
SERVICE DOCUMENT (HATEOAS)
ODATA URI CONVENTIONShttp://services.odata.org/OData/OData.svc/Category(1)/Products?$top=2&$orderby=name _______________________________________/ __________________/ _________________/ | | | service root URI resource path query options
Root http://services.odata.org/OData/OData.svc/Resource Path /ProductsQuery Options $filter=price lt 3.5
Entity Set /ProductsSingle Entity /Products(3)Member Access /Products(3)/PriceLink Traversal /Products(3)/Supplier
URI SYNTAX
ATOMPUB - EDM (HATEOAS)
Atom / AtomPub
Property
Entry
Collection / Feed
Service
EDM
Property
Entity
Entity Set
Entity Container
ATOM ENTRY
OASIS ODATA 4.0
Design Goals
• A "web of structured data" without boundaries between isolated services
• Request exactly the desired subset of data with as few roundtrips as possible
• Keep the query language simple and intuitive
• Make all features of OData combine well with each other
• Keep each single feature as simple as possible
• Avoid having several ways to achieve the same goal
• Model Evolution (Versioning)
• Model Reuse and Cross-Service Navigation
• Deltas
• Asynchronous Requests and Callbacks
• Vocabularies and Annotations
• Actions and Functions
• Improved Query Language ($search, CrossJoin, Lambda …)
• Improved Type System
• Entity References
• New JSON
• MISC (stream properties, geo data types, any()/all() operators …)
PART II
LET’S PLAY WITH ODATA AND DO SOME
DEMOS
QUESTIONS & ANSWERS
SOURCES AND CONTACT
http://odata.org http://olingo.apache.org https://www.oasis-open.org/committees/odata/
Stephan Klevenz PMC Member of Apache Olingo [email protected] @sklevenz