users@jersey.java.net

Re: [Jersey] 1)regaring testing http POST of restful webservices with multiple parameters and 2) restful file uploading

From: Paul Sandoz <Paul.Sandoz_at_Sun.COM>
Date: Wed, 14 May 2008 12:57:55 +0200

Bruno Luiz Pereira da Silva wrote:
> What we did was identifying a new Order resource. This resource was not
> one of the business objects. We didn't have an Order class in our domain
> model. But using this new Resource made everything much clearer. The
> operation become the creation of a new Order resouce. The Order resource
> contains the products and the billing data.
>

It is nice to read this :-) this is often a blocking point when in the
design process. The solution can appear rather simple afterwards but it
is not always obvious how to get to it. It is really easy to "mint" new
URIs, create URIs for all important information you need to expose.

For example, a developer a JavaOne asked me how could one set the state
on multiple printers all at once (e.g. disable) rather than performing
multiple requests to all printers. One could have a resource for a set
of printers that represents the current aggregated state. One could PUT
to this URI to update the state for all printers. Another solution is to
POST to a general printers resource with the set of printers+state one
wants to change, but it makes it harder to GET the aggregated state.

Paul.

-- 
| ? + ? = To question
----------------\
    Paul Sandoz
         x38109
+33-4-76188109