Wrestling With The Immaturity of Level 3 REST

Guest Author, August 21st, 2012

This guest post comes from Matthew Bishop, senior architect of Elastic Path, a provider of digital commerce software for enterprises.

This post explores the challenges we faced in building out our own commerce API and how we wrestled with the general immaturity of Level 3 REST.

We wanted to create an easy-to-use API that can be used in a wide variety of contexts from mobile devices, websites and set top boxes. This type of API demanded that capabilities be provided in a resource-centric model rather than other models like Services or MVC. This gave us the opportunity to “start over” and re-imagine commerce in a more holistic, yet straightforward user-centric domain. Rather than publishing the capabilities into the API, we created new resources that provided state based on these capabilities.

As an example, our internal product model has a wide variety of product options, configurations, bundling options and merchandizing rules. The API, however, boils these down to products and components that can have selectable features. By unifying these in the API, the client developer is not burdened with knowing the difference between a configurable bundle and a multi-sku product. They just know that a product has selectable options. The internal capabilities are retained in our Commerce Manager tooling because they make sense given the goals for each product, but the API consumer is not aware of these differences. This approach allows us to create new, innovative productization strategies without forcing the clients to update along with the new merchandizing features.

The biggest challenge we faced overall was the lack of maturity in Level 3 REST. The key aspect of Level 3 REST that we solved in our API was managing the links between resources. This key aspect of REST is really important because it gives the client developer a way to write apps that know the names of related data and actions without having to know the addresses of these links or how to build them. It’s like moving from Assembly language to C; in Assembler one cares a lot about how memory addresses are structured. In C, you don’t care so much about addresses, you care about the names of things instead. The compiler takes care of the addresses for you.

For our commerce API, we standardized several concepts in Level 3 REST by giving them clear names and places to live in the Representation. For instance, all links live in one place: a “links” array at the root of the representation. Links go nowhere else. This makes it easy for a client dev to find links regardless of where the representation came form. Another concept we standardized was the link names themselves; links that are POSTable end with the term “action” so a client developer can understand what to do with a link that is used to create new representations or execute state. Our API has other similar standardizations that normalize the representations across the API; this makes it faster to understand and use.

In my next post, I will delve into how we made our commerce API scale for global commerce needs.

Both comments and pings are currently closed.

3 Responses to “Wrestling With The Immaturity of Level 3 REST”

August 24th, 2012
at 3:48 am
Comment by: Distributed Weekly 169 — Scott Banwart's Blog

[...] Wrestling With The Immaturity of Level 3 REST [...]

November 18th, 2012
at 6:19 pm
Comment by: purses

Hello there, just became aware of your blog via Google, and identified that it truly is truly informative. I’m going to watch out for brussels. I’ll be grateful should you continue this in future. Numerous folks will be benefited from your writing. Cheers!
purses http://buytomsshoes.webs.com/apps/blog/show/19699994-all-these-toms-shoes-appear-similar-at-1st-look-but-on-scrutinizing-intently

November 18th, 2012
at 6:20 pm
Comment by: handbags

The when I just read a weblog, I’m hoping that this doesnt disappoint me approximately this 1. Get real, Yes, it was my method to read, but When i thought youd have something interesting to state. All I hear is actually a number of whining about something which you could fix should you werent too busy trying to uncover attention.
handbags http://buytomsshoes.webs.com/apps/blog/show/19700168-all-you-need-to-get-the-discount-is-to-enter-the-toms-coupons-code-during-check

Follow the PW team on Twitter

APIs, mashups and code. Because the world's your programmable oyster.

John Musser
Founder, ProgrammableWeb

Adam DuVander
Executive Editor, ProgrammableWeb. Author, Map Scripting 101. Lover, APIs.