Last modified 6 years ago Last modified on 07/16/11 21:44:26

Implementing REST style protocols, quick reminders

Use generic REST Protocols

Re-use those protocols wherever possible, they are well tested, accepted and have extensive tooling available...

The Atom Syndication Format (Atom, RFC4287)::

Generic format for lists of metadata

The Atom Publishing Protocol (AtomPub, RFC5023)::

For writing back changes to resources. The Apache Abdera project provides a good Java library for it.

OpenSearch::

OpenSearch is a collection of simple formats for the sharing of search results. It is supported out of the box by a large amount of software, including most web browsers and most search widgets.

Quick protocol design reminders

  • Navigable interface rather than template generators
    • Whenever possible, client code should NOT have to know how to generate URLs. They should be directly provided, in full, by the server.
  • HATEOAS: Hypermedia as the engine of application state
    • The client is responsible for maintaining application state, the server for making sure only valid transitions are allowed
  • PUT, DELETE must be idempotent
  • GET may not have side effects

For a bit more details, see the article RESTful Web Services Development Checklist (pdf)

Java libraries to help consume or serve REST interfaces

Articles sur Jax-rs avec spring

0.9.8 © 2008-2011 Agilo Software all rights reserved (this page was served in: 0.66868 sec.)