Resource-Oriented Architecture-restful Web Services Chinese edition

Source: Internet
Author: User

Resource-Oriented Architecture

The Resource-Oriented Architecture

I have shown you the rest capability, but I have not systematically explained how it is formed and how it is presented. In this chapter, I will outline a specific restful architecture-Resource-Oriented Architecture (ROA ). ROA is a way to convert a real problem to a rest-type Web Service: it allows Uris, HTTP, and XML to work in the same way as other web applications.ProgramThey are easy to use.

In Chapter 1st, I classify restful Web Services based on their different practices on two issues. These two problems correspond to two of the four signature features of rest.

Scoping Information ("Why is this data sent by the server, not other data?") -- this information is stored in the URI. This is the addressability principle.

Method Information ("why should the server send instead of Delete the data ?") -- This information is stored in the HTTP method. There are only a few HTTP methods, and everyone knows the role of these methods in advance. This is the uniform interface principle.

In this chapter, I will introduce the functional components of the Resource-Oriented Architecture (ROA): resources, resource names, resource representations, and links between resources. I will explain and publicize the features of ROA: ssability, statelessness, connectivity, and unified interface ). I will demonstrate how Web technologies (HTTP, Uri, and XML) implement these functional components to obtain the above features.

In the previous chapters, I used some existing web services (such as S3) to illustrate some concepts. In this chapter, I will refer to some existing web services and some existing websites (web sites) to explain the concept. I hope that at this moment, I have convinced you that "websites are Web Services, and many web applications (such as search engines) are restful Web Services. When I talk about some abstract concepts (such as Addressable), I will give some real Uris, so that you can input these URIs in a browser to learn about these concepts.

Resource-Oriented Architecture?

Resource-Oriented what now?

Why is it necessary to invent a new term "Resource-Oriented Architecture (ROA?

Why not use rest directly? Well. I did mention rest on the cover of this book, and I think a Resource-Oriented Architecture also fits the REST style.

However, rest is not an architecture, but a set of design principles. You can say "one architecture is better than the other in terms of following these principles", but you cannot say "Rest architecture" because there is no such thing as "Rest architecture.

So far, people have become accustomed to inventing one-off architecture (one-off ubuntures) based on their own understanding of rest when designing services ). The most notable result of doing so is the generation of a wide variety of REST-RPC Hybrid Web Services, which the creators also claim to be restful. To this end, I propose a set of specific rules for building truly restful web services, in order to end this situation. In the next two chapters, I will give some simple steps. You just need to follow these steps to convert your requirements into resources ). Even if you do not like my rules, you can at least know which changes will not lead to a violation of the REST style.

As a set of design principles, rest is very common. Specifically, it is not limited to web. Rest does not depend on the HTTP mechanism or Uri structure. However, because I am talking about Web Services, I specifically use web-related technologies to explain the Resource-Oriented Architecture (ROA ). I wantProgramming LanguageThis section describes how to use HTTP and URI to implement rest. If there is a non-Web-based rest architecture in the future, its best practice (best practices) will be similar to Roa, but the details will be slightly different. There will be a solution.

The traditional definition of rest leaves some gaps, which creates a folklore environment for practitioners. I would like to go further with Roy Fielding's doctoral thesis and W3C standards-I hope to end some of the issues and extract those rumors into a set of well-defined best practices. Even if rest is an architecture, it is unfair to call it my architecture. I will combine my practical experience and suggestions with the overall ideas about web.

The root cause of ROA's new word is that the word "rest" is used too much in the school competition. If someone mentions this term, it usually implies that the architecture he himself agrees with is a real rest-style architecture, and those who agree with other rest-style architectures disagree. Although restCommunityThere has been an agreement on some basic issues (such as the value of Uri and HTTP), but there are still different factions in the rest community.

The ideal situation is that there is no faction competition. However, too much experience tells me that it cannot be ended by willingness alone. Therefore, give me a different name for my idea of "how to design a rest-style application. In this way, in case these ideas are inevitably used in the school competition, those who disagree can target my Resource-Oriented Architecture (ROA ), instead of mixing it with a rest-style architecture or a general rest. First, we need to clarify the concepts before we can understand them.

"resource-oriented" and "Resource-Oriented Architecture) such wording has been used to describe a general rest-style architecture (note 1 ). I admit that "Resource-Oriented Architecture" is not entirely my original words, but my usage is just in line with the previous usage, and I think it is better to use this word than to claim to represent the entire rest.

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.