Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Why REST is an Architectural Style and not an Architecture?

I am working in a RESTful application and when I was reading about REST, I found that REST is an Architectural Style and not an Architecture but I do not understand the reason. Thanks for your answer.

Sorry for my English, it is not my native language.

like image 547
user2837730 Avatar asked Jan 12 '23 05:01

user2837730


2 Answers

An architecture is prescriptive, often giving blueprints for solutions, and defining the core building blocks. For instance, "client-server" architecture defines a client, a server, and the roles those two components play.

An architectural style provides a framework for thinking about solutions - in the case of REST, the concept of resources addressable through a URL, a vocabulary for manipulating those resources, statelessness etc.

This is important, because the question "is this a client server architecture" can easily be answered - is there a client, does it connect to the server, are there clear responsibilities for each? The question "is this a RESTful solution" is much harder to answer - it requires you to see if the solution follows the mental model of REST.

like image 150
Neville Kuyt Avatar answered Jan 14 '23 19:01

Neville Kuyt


REST provides guidelines for designing distributed systems, mainly "hypermedia" systems. This is based on the work of Roy Fielding. To make it clear between the "architectural style" and "architecture" you can think of the "architecture style" as a set of principles to design "concrete architectures" (or concrete implementations). In the case of REST, you can see for example that several concrete implementations were defined, for example java has developed its own implementation of the REST architectural style: JAX-RS (https://jax-rs-spec.java.net/ , https://jax-rs-spec.java.net/nonav/2.0/apidocs/index.html).

like image 39
emgsilva Avatar answered Jan 14 '23 19:01

emgsilva