The answers to these questions lies in Roy's T. Fielding dissertation so I'll just list them here.
Null style: means there are no other constraints then following.
Client-Server: client wants something, server has it and can be asked for it by client. Still client and server can evolve independently.
Fulfillment of Client-Server constraint improves portability of the user interface across multiple platforms and improve scalability by simplifying the server components. And components can evolve independently.
Stateless: the request from client to server must contain all information so the server can understand the request. In other words, only client keeps information about it's state.
Fulfillment of stateless constraint gives our applications following three traits:
- Visibility - monitoring system does not have to look beyond a single request in order to determine the full nature of the request.
- Reliability - eases the task of recovering from partial failures.
- Scalability - server can quickly free resources and doesn't have to manage resource usage across requests.
Cache: all the data within response can be labeled as cacheable or non-cacheable.
Fulfillment of cache constraint is improving network efficiency, scalability and user perceived performance by reducing the average latency of interactions.
Uniform Interface: implementations are decoupled from the services they provide. Informations are transfered in standardized form. To obtain an uniform interface we need to define interface constrains. For REST they are:
- identification of resources: we can address desired information and we can recognize them.
- Manipulation of resources through representations: we are manipulating with representation of resource, not with resource itself and in a format which suits the client. Although it can be same as original resource.
- Selfdescriptive messages: the messages consist of data, metadata describing the data, and optionally metadata describing metadata.
- Hypermedia as the engine of application state: server is master of it's resources. The resource implementation details are hidden behind the interface. Server publish it's interfaces as resource hiearchy. Server does not tell which method is supposed to use with which URI.
Layered System: whole system is divided to layers. The component of each layer can "see" only it's immediate layer.
Fulfillment of Layered System constraint improves internet-scale requirements. Bounding overall system complexity and promoting substrate independence.
Code-On-Demand (optional constraint): client functionality can be extended by downloading and executing code (scripts for example).
Needed features doesn't have to be implemented in client at the time of compilation.
Žádné komentáře:
Okomentovat