REST Framework
A REST Framework is a Web-API framework that allows the creation of a RESTful service (which follows the REST distributed-systems pattern).
- Example(s):
- Django REST Framework, for Django Framework and Python programs.
- Spray REST Framework, for Akka Framework and Scala programs.
- See: Zend REST Framework.
References
2009
- http://code.google.com/p/implementing-rest/wiki/RESTDevelopmentPrinciples
- Development tools that enable a REST-style result:
- Encourage application implementations as a collection of RESOURCES on a server (i.e. programming using a resource object)
- Encourage the use of CACHING (making it easy to express and interpret caching directives for both client and server)
- Encourage STATELESS interactions between client and server (making it hard to store transient state on the server, easy to store transient state on the client)
- Encourage using a UNIFORM INTERFACE (with clearly defined semantics) for interacting with RESOURCES (programming using a limited set of public methods that follow protocol rules)
- Encourage using a LAYERED SYSTEM as an implementation principle (making it easy to add authentication, caching, CDNs, etc. without re-writing existing code)
- Encourage using CODE-ON-DEMAND to safely extend functionality at runtime (support servers sending scripts and plug-ins to clients, support accepting and executing plug-ins and scripts safely on the client)
- In addition, the development environment should:
- Encourage the use of SELF-DESCRIPTIVE messages through:
- Clear separation between control-data (HTTP Headers) and message bodies
- Dependence (and ease of use) on media-types.
- Full and easy control of caching directives (including automatic marking of GET responses based on configuration information)
- Encourage implementing resources as REPRESENTATIONS (using media-types to express resource representations) through:
- Ability to mark resources and methods as supportive of one or more media types
- Easy access to serialization/transformation of resource data into media-type compliant representations.
- Ability to determine the beset match representation format (media type) for the client (e.g. support for server-driven and/or agent-driven content negotiation)
- Encourage implementing RESOURCE IDENTIFIERS (using URI mapping to match request URIs to server-side code)
- Encourage hypermedia to power application state (including mutually-agreed upon annotated links and link templates in the representations)
- Encourage the use of SELF-DESCRIPTIVE messages through:
- Development tools that enable a REST-style result:
2011
- https://sites.google.com/site/restframework/
- This site presents a REST Framework suitable for adoption by standards bodies like IMS and SIF. The existence of such a site begs a question (really two questions): What is a REST Framework and why do we need one?
For some, a “REST Framework” is a toolkit that helps the developer build a REST API. Though we will have things to say about toolkits, that's not the sense of the term framework that we are using on this site. For us, a framework is a collection of principles that guide the specification of a REST API.
As an architectural style, REST itself is essentially a collection of guiding principles. These principles tend to be very abstract. Consider this one from Roy Fielding's blog :
That's great, but exactly what media types should be defined, and how should they be described?“A REST API should spend almost all of its descriptive effort in defining the media type(s) used for representing resources and driving application state, or in defining extended relation names and/or hypertext-enabled mark-up for existing standard media types.”
- This site presents a REST Framework suitable for adoption by standards bodies like IMS and SIF. The existence of such a site begs a question (really two questions): What is a REST Framework and why do we need one?