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.