Restful Objects
Restful Objects is a standard covering RESTful interfaces to domain object models. The specification is published under a Creative Commons license.
Representations and resources defined by the standard
The standard defines a small set of JSON representations covering the generic constructs in a domain object model including the following:- A list of links to domain objects
- A single domain object
- A property, collection, belonging to a domain object
- An action that may be invoked on a domain object
- An action result
- A domain service
- A small number of very specific representations such as Home, Version, and User.
HTTP method | Object | Property | Collection | ||
GET | Object summary, member summary, property values | Property, details and value | Collection details and content | Action prompt | Invoke |
PUT | Update or clear multiple property values | Update or clear value | Add object | – 405 error | Invoke |
DELETE | Delete object | Clear value | Remove object | – 405 error | – 405 error |
POST | – 405 error | – 405 error | Add object | – 405 error | Invoke |
Taken together the resources and representations allow the complete functionality of a domain object model to be accessed over HTTP. The following diagram, taken from the specification, illustrates the relationship between the most commonly used resources and representations:
History and status
The Restful Objects specification version 1.0.0 was released in June 2012.Framework implementations
There are three known implementations of the Restful Objects specification, all open source:- Naked Objects for.NET
-
Relationship to other ideas
There is an overlap with the naked objects pattern, in that both are concerned with creating generic interfaces to domain objects models. But while the latter creates some kind of user interface, Restful Objects creates an API - specifically a Restful API. The first two frameworks to implement the Restful Objects standard were both built on top of existing frameworks that implement the Naked Objects pattern.