Question

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.

Was it helpful?

Solution

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.

OTHER TIPS

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).

Hmm, I don't know exaxtly, but I think, it because REST describes only, that should be resources, represented by unique URLs, and actions for them, represented by HTTP-verbs and request data. But data format, are resources objects or not - decision of developer.

Maybe, even HTTP is not necessary.

I don't know why REST is called an "architectural style". For me, REST is just a protocol for doing synchronous calls (in most cases). In the programs, you still have action based methods (like getAccount, transferAmount, createUser etc.) All these methods can be implemented using REST. Or SOAP. Or some other protocol. And all of them assume some data model.

So, in my view, REST is neither architectural style nor an architecture.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top