Restful Objects

Jump to content
From Wikipedia, the free encyclopedia

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

[edit]

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 (which will typically include a domain object or list)
  • A domain service (essentially a stateless domain object)
  • A small number of very specific representations such as Home, Version, and User.

Restful Objects also defines a standard set of resources for accessing or manipulating these representations. The specification defines which HTTP methods may be used with each resource, and their meaning. The table below shows a partial summary:

HTTP methodObjectPropertyCollectionAction[clarify]Action Invoke[clarify]
GETObject summary, member summary, property valuesProperty, details and valueCollection details and contentAction promptInvoke (if query only)
PUTUpdate or clear multiple property valuesUpdate or clear valueAdd object (if set semantics)N/a – 405 errorInvoke (if idempotent)
DELETEDelete objectClear valueRemove objectN/a – 405 errorN/a – 405 error
POSTN/a – 405 errorN/a – 405 errorAdd object (if list semantics)N/a – 405 errorInvoke (any)

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:

Principal resources and representations defined by the restful objects specification

History and status

[edit]

The Restful Objects specification version 1.0.0 was released in June 2012.

Framework implementations

[edit]

There are three known implementations of the Restful Objects specification, all open source:

Relationship to other ideas

[edit]

The Restful Objects specification states that it operates at a higher-level of abstraction than other restful standards such as the JAX-RS specifications for Java platform, or the WCF specification on .NET. There are some conceptual similarities to Odata - though Restful Objects places much more emphasis on exposing the behaviour of domain objects, not just their data.

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.

[edit]
  • "The Restful Objects specification".
  • "Introducing: 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 (which will typically include a domain object or list)
    • A domain service (essentially a stateless domain object)
    • A small number of very specific representations such as Home, Version, and User.

    Restful Objects also defines a standard set of resources for accessing or manipulating these representations. The specification defines which HTTP methods may be used with each resource, and their meaning. The table below shows a partial summary:

    HTTP methodObjectPropertyCollectionAction[clarify]Action Invoke[clarify]
    GETObject summary, member summary, property valuesProperty, details and valueCollection details and contentAction promptInvoke (if query only)
    PUTUpdate or clear multiple property valuesUpdate or clear valueAdd object (if set semantics)N/a – 405 errorInvoke (if idempotent)
    DELETEDelete objectClear valueRemove objectN/a – 405 errorN/a – 405 error
    POSTN/a – 405 errorN/a – 405 errorAdd object (if list semantics)N/a – 405 errorInvoke (any)

    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:

    Principal resources and representations defined by the restful objects specification

    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:

    • Apache Causeway (for the Java platform)
    • Naked Objects for .NET (for the .NET platform)
    • Restful Objects for Ruby (for the Ruby platform)

    Relationship to other ideas

    The Restful Objects specification states that it operates at a higher-level of abstraction than other restful standards such as the JAX-RS specifications for Java platform, or the WCF specification on .NET. There are some conceptual similarities to Odata - though Restful Objects places much more emphasis on exposing the behaviour of domain objects, not just their data.

    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.

    • "The Restful Objects specification".
    • "Introducing: Restful Objects".
    Retrieved from "https://en.wikipedia.org/w/index.php?title=Restful_Objects&oldid=1227699656"