Starbucks rest Case Analysis

Source: Internet
Author: User
Tags format definition

I received a recommendation email from infoq today. I was very interested in reading the title. It took some time to read it. It was a good case analysis and I learned a lot. Let's take a rough look at someArticleKey content. Case: http://www.infoq.com/cn/articles/webber-rest-workflow

1. Complete status migration through rest service requests, and use options reasonably to view resource operation permissions.

2. reasonably use HTTP heads to return the resource Uri, determine the operation result through errorcode, and perform post-processing.

3. Specify the subsequent process resource positioning and operations by returning the content to achieve the process.

4. Prevent concurrent modification by comparing two versions of the put header. (In fact, it can also be optimized to query the cache)

5. Use the atom protocol to publish and manage resources (atom is the most suitable data source format definition for rest Services)

6. Use the URI template with caution. If you are sure to abstract the resource positioning.

7. Auth can be implemented through authentication or WS-* in the lightweight HTTP head. (It can also be implemented through https)

In general, after analyzing the entire case, we can find that to streamline the service, the premise is that the data interaction format is uniform (XML, atom ), then, use the HTTP protocol as the service protocol rather than the bearer protocol, and use the existing operation conventions to mark the header of the message and return the error code to migrate the resource status, at the same time, by embedding process-based content in the returned content, the entire process can run through. (Simple process concatenation. In fact, if complicated logic definitions are added to the process rule protocol, a more powerful Web workflow can be implemented ).

However, for open APIs or similar restful business, security is still the biggest challenge, especially in resource access control. Of course, it can be similar to WS-Security to propose a more secure and mature solution, but the performance and ease of use will be greatly reduced, and the advantages of rest itself will be lost.

Do a bit of advertising: http://www.blogjava.net/cenwenchu/archive/2008/12/10/245414.html is my next Monday will be made on open API internal training PPT, interested students can look.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.