OData the silo buster

June 14, 2011

Introduction

Like many others I am eagerly awaiting the release of SAP Netweaver Gateway, a technology which promises to simplify SAP integration. By exposing SAP Business Suite functionality as REST based OData services Gateway will enable SAP applications to share data with a wide range devices, technologies and platforms in an easy to understand and consume manner.

The intention of this blog is to give a high level overview to the Open Data Protocol (OData), showing by example how to access and consume the services.  For a more concise definition I recommend the following recently released article – Introducing OData – Data Access for the Web, the cloud, mobile devices, and more

What is OData?

“OData is to Rest what MS Access is to databases”  a complimentary tweet I read, because MS Access is very easy to learn it allows users to get close to the data and empowers them to build simple and effective data centric applications.

“OData can be considered as the ODBC API for the Web/Cloud” Open Database Connectivity (ODBC) is a standard API independent of programming language for doing Create, Read, Update and Delete (CRUD) methods on most of the popular relational databases.

“OData is a data silo buster” 

image

Source: SAPNETWEAVER GATEWAY OVERVIEW

Essentially OData is an easy to understand extensible Web Protocol for sharing data. Based on the REST design pattern and AtomPub standard, it provides consumers with a predictable interface for querying a variety of datasources not only limited to traditional databases.

OData Services

Odata.org provides a sample of the Northwind Database exposed as OData formatted services, this is a great resource for exploring the protocol.

**If you are using IE you may want to disable the feed reading view.

The link below is to the Northwind service document, it lists all of the service operations, each operation represents a collection query-able data.

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

image

To access the Customers collection we append the link provided above to the base url as follows

http://services.odata.org/Northwind/Northwind.svc/Customers/

We can accesses specific Customers via the links provided in the feed http://services.odata.org/Northwind/Northwind.svc/Customers(‘ALFKI’)

With the query string operations we can start to control the data provided, for example paging Customers 20 at a time.

http://services.odata.org/Northwind/Northwind.svc/Customers?$top=20 http://services.odata.org/Northwind/Northwind.svc/Customers?$skip=20&$top=20

Using filters we can search for Customers in a particular city or Products in our price range

http://services.odata.org/Northwind/Northwind.svc/Customers?$filter=City eq ‘London’

http://services.odata.org/Northwind/Northwind.svc/Products?$filter=UnitPrice le 200 and UnitPrice gt 100

Once we have found the data we wanted we can use the links to navigate to the related data. http://services.odata.org/Northwind/Northwind.svc/Suppliers(2)/Products

http://services.odata.org/Northwind/Northwind.svc/Products(5)/Order_Details

Finally we can format the response as JSON

http://services.odata.org/Northwind/Northwind.svc/Products(5)?$format=json

image

Consuming OData

To illustrate how easy it is to consume OData, I am sharing simple JQuery Mobile application, it uses the following tables and relationships.

image

OData Sample Application – hopefully the 100 lines of HTML code, JavaScript and annotations are easy to follow, copy the source to a html file, save it locally and run in a browser. Best viewed in the latest versions of Firefox, Chrome and IE.

image image image

Opening up more than data

A couple of months ago I set off on a exercise to learn all I could about OData, along the way I started investigating some of the available opensource libraries like datajs and odata4j, rediscovering a passion for JavaScript and Java.  Through the many examples and resources available it was surprising how easy it was to take my limited skills into the world of Cloud and Mobile application development.

Conclusion

Similar in many ways to ODBC and SOAP, OData is an initiative started by Microsoft as means for providing a standard for platform agnostic interoperability. For it to become successful it needs to be widely adopted and managed.

From a high level the strengths of OData are that it can be used with a multitude of data sources, it is easy to understand and consume. From what I have seen it will be great for simple scenarios and prototyping. Early to tell what its real weaknesses are, however to be simple and easy to use there has to be either a lot of pipes and plumbing or constraints and limitations when used on top of technologies like BAPI’s and BDC’s, things like managing concurrency, transactions and state come to mind. Conversely the threats of not being adopted and competing standards and initiatives like RDF and GData represent some big opportunities for an extensible protocol.


SAP TECHED 2007 LAS VEGAS (redux)

June 5, 2008

This years SAP Teched tells us to
“CONNECT. COLLABORATE. CO-INNOVATE!”

  • Connect, collaborate, and co-innovate with the best minds in the IT industry.
  • Get the knowledge, skills, and professional network needed to take advantage of SOA.
  • Learn how to use the power and flexibility of SAP NetWeaver to co-innovate with SAP
  • Inspiring I know. Before you run off to convince your boss that you should go to Vegas for a week long jolly. Enjoy
    “ENTERPRISE SOA – PUT THE POWER TO WORK!”
    Read the rest of this entry »


    SAP Certification gets a makeover

    May 26, 2008

    Queer eye for a SAP guy

    Move over big 5, training needs a makeover

    IN a radical move, German enterprise software giant SAP has finally loosened the grip on its tightly held training and certification program as the shortage of skilled consultants worsens.

    SAP certification gets total makeover | Australian IT

    The comments make for interesting reading.

    In the news i hear about this perceived shortage of labor. In the same bulletin you hear big bank has outsourced entire IT operations, large employer investigated for underpaying workers on 457 visas.

    Shortage of skilled consultants – Isn’t this just propaganda and the real shortage is cheap experienced labor?

    Read the rest of this entry »


    Enterprise Service Bus (ESB) and SAP

    May 16, 2008

    I read everywhere that you need an ESB to truly implement SOA.

    Having read many articles about what an ESB is, I am still unsure whether it is a product or a pattern.

    If it is a product does SAP have one ?

    Read the rest of this entry »


    Poetry runs as hard as SAP

    May 16, 2008

    In the book Moby Dick captain Ahab time and again foresakes all commercial endeavors and risks his ship and crew in attempts to capture the big white whale.

    SAP’s nemesis isn’t Oracle its the SMB market, they have had numerous attempts at conquering the beast – A1, Business One, plus numerous pre configured and hosted solutions. SAP is not alone Microsoft and Oracle and others are desperately trying to fill their whitespaces.
    Read the rest of this entry »