Learning rest together (8) -- rest architecture component

Source: Internet
Author: User

Original address: http://rest.elkstein.org/

Learn rest: a tutorial

The rest architecture includes the following key components:

  • Resources), Identified by logical URLs, status andFunctionAll are represented by the resource.

    • The logical URL means that other parts of the system can access resources.
    • Resources are a key element of restful design.As the "method" and "service" in RPC and soap Web services are different, in rest, you do not need to publish "getproductname" and then call "getproductproce" rpc. You only need to regard data as a resource, which contains specific request information (or corresponding links)
  • A web of resources)This means that a single resource should not be too large and requires good granularity. At any time, a resource should contain or can be linked to additional information-just like a web page
  • The system hasClient-server ),Of course, one component is the server and the other component is the client.
  • The connection is stateless.Interaction is stateless (although servers and resources can be stateful). Every new request should contain all the information required to complete the request, instead of relying on the previous interaction information of the same client.
  • Resources should be available at any timeCachable)(There is a validity period ). The Protocol must allow the server to display whether the execution is cached resources and how long the cache takes.
    • Because the rest protocol uses HTTP, the HTTP Cache control header can be used for this purpose.
    • The client must follow the cache machine specified by the server for each resource.
  • Proxy ServerIt can be used as part of the architecture to improve performance and scalability, and standard HTTP proxy can be used.

Note that your application is not based on the Rest architecture.Use the rest Service(As a client), such as a single machine, non-rest programs can access third-party rest services.

Related Article

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.