What is resource-oriented architecture (ROA)?
Resource-oriented architecture (ROA) is an architectural style that extends the REST architectural style and offers a broader, extensible, flexible, and transport-independent architecture. The resource-oriented architecture (ROA) paradigm is built around the concept of a resource. A resource is a self-contained, identifiable entity with state that can be assigned a universal resource identifier (URI). Whereas a service is the execution of a requested action, a resource is a distributed component managed through a consistent, standardized interface.
One characteristic of resource-oriented architecture is that it is transport-independent. Therefore, there must be mechanisms for exposing resource-oriented services to the outside world. When a consumer requests a Uniform Resource Locator (URL) and specifies an access method (such as GET, PUT, POST, and DELETE), the URL is translated into a relative internal URI. The access method is then carried out.
Resource-oriented architecture is based on just four concepts:
- Resources
- URIs
- Representations
- Links and connectivity
Here are the four properties of resource-oriented architecture:
- Addressability
- Statelessness
- Connectivity
- Uniform interface
Resource-oriented architecture: resources
Resources are the building blocks of ROA; a resource is a logical representation of information. For example, a student is an abstract collection of data points that can be represented in various ways, including XHTML, JSON, and XML. A resource name includes the following:
- Resource type
- Resource identifier
- Parent resource name
- API service name.
A resource is the most important abstraction of information in REST or RESTful architecture. The term “resource” refers to any identifiable information. That information can be a document, a computer, a car, a temporary service (such as “today’s weather in Ohio”), a collection of other resources, a person, a student, and so on.
Each representation of an immutable resource is identified by a relative Uniform Resource Identifier (URI) and may include links to other resources, as well as to other immutable resources. Note that a resource can also have multiple URIs.
Each resource must have the following characteristics:
- must be unique
- must have at least one representation
- it has attributes and a schema that can be accessed and can provide context
Uniform Resource Identifier (URI)
A Uniform Resource Identifier (URI) is a sequence of characters that contains a resource’s name and address and is used to identify a logical or physical resource. Note that a resource must have one or more URIs. Without a URI, a piece of information is not considered a resource, since it cannot be referenced or accessed. You can use a URI to identify anything, such as real-world objects, web pages, books, and so on.
Characteristics of resource-oriented architectures (ROA)
Here are the four main properties of resource-oriented architectures:
Addressability
Addressability is an important property of resource-oriented architectures. An application can be considered addressable if it publishes interesting aspects of its dataset as service endpoints. These services, in turn, can be used to work with the application’s data. Since resources in ROA are provided using URIs, an application must provide its data using URIs.
Statelessness
Statelessness is another characteristic of resource-oriented architectures, meaning that each HTTP request in this architecture is handled in isolation. In other words, when a client requests a resource from a server, the client must provide all the information the server might need to fulfill the request successfully. The server never retains information from previous requests; that is, no state information is stored on the server. If the server needs information from an earlier request to process a request, the client must send that information again in another request.
Connectivity
In resource-oriented architecture, representations are hypermedia: documents containing both data and links to other resources. RESTful web services follow the principle of Hypermedia As The Engine Of Application State (HATEOS). This principle says that the data format affects transition states in your application. Links to other resources are embedded in the response, but they may vary for the same resource depending on its current state.
One of the most important characteristics of the web is its interconnectedness. That is, practically all information on the Internet is connected through hyperlinks. A hyperlink can be used to connect any resource available on the Internet to another resource. An application built on ROA should have all its resources linked to one another, and vice versa. When we choose a suitable representation for a resource, we can achieve connectivity in the application.
Uniform interface
You must have a set of well-defined methods that can manipulate your application’s resources. For example, HTTP provides the following common operations that you typically need to perform in any application:
- HTTP GET — retrieve a resource
- HTTP POST — create new resources
- HTTP PUT — modify an existing resource
- HTTP DELETE — delete an existing resource
HTTP HEAD and OPTIONS methods
Here are two other important HTTP methods you should know:
HTTP HEAD — used to retrieve a representation of a resource consisting only of metadata.
HTTP OPTIONS — used to check which HTTP methods are supported by a particular resource.
To sum up
Resource-oriented architecture is stateless and revolves around resources. A URI is used to identify each resource. You can always have several copies of the same resource on your computer at the same time. You can also have multiple URIs for one resource.









