I’ve been looking into which javascript frameworks to use lately and have seen REST and REST-persistable being branded around quite a lot but have no idea what they are referring to.
I’ve been looking into which javascript frameworks to use lately and have seen REST
Share
RESTor Representational State Transfer is actually a server-side term that refers to a certain architectural style of web services. It was coined by Roy Fielding in his PhD thesis.Central concept in
RESTis the existence of resources (sources of data), each of which is referenced with a global identifier (e.g., a URI in HTTP). In order to manipulate these resources, components of the network (user agents and origin servers) communicate via a standardized interface (e.g., HTTP) and exchange representations of these resources (the actual documents conveying the information).For a Javascript framework, it mostly means using each
HTTPverb only according to its intended purpose. That is, remove stuff withHTTP DELETE, add stuff withHTTP PUT, read stuff withHTTP GETand so on. Also,RESTmeans conforming to a naming standard that maps data entities directly to human readable URLs.Main features of REST [source]
Client–server – A uniform interface separates clients from servers. This separation of concerns means that, for example, clients are not concerned with data storage, which remains internal to each server, so that the portability of client code is improved. Servers are not concerned with the user interface or user state, so that servers can be simpler and more scalable. Servers and clients may also be replaced and developed independently, as long as the interface between them is not altered.
Stateless – The client–server communication is further constrained by no client context being stored on the server between requests. Each request from any client contains all of the information necessary to service the request, and any session state is held in the client.
Cacheable – As on the World Wide Web, clients can cache responses. Responses must therefore, implicitly or explicitly, define themselves as cacheable, or not, to prevent clients reusing stale or inappropriate data in response to further requests. Well-managed caching partially or completely eliminates some client–server interactions, further improving scalability and performance.
Layered system – A client cannot ordinarily tell whether it is connected directly to the end server, or to an intermediary along the way. Intermediary servers may improve system scalability by enabling load-balancing and by providing shared caches. They may also enforce security policies.
Code on demand (optional) – Servers are able temporarily to extend or customize the functionality of a client by the transfer of executable code. Examples of this may include compiled components such as Java applets and client-side scripts such as JavaScript.
Uniform interface – The uniform interface between clients and servers, discussed below, simplifies and decouples the architecture, which enables each part to evolve independently.
There are mountains of good information about this topic. For example, A Brief Introduction to REST