users@jersey.java.net

[Jersey] Re: ROA Conceptual Questions

From: Jason Erickson <jason_at_jasonerickson.com>
Date: Mon, 6 Jun 2011 17:46:07 -0700

You might get more responses at the Yahoo group rest-discuss. http://tech.groups.yahoo.com/group/rest-discuss/. Not sure about better responses, but that forum is exactly for these kinds of questions.

On Jun 6, 2011, at 4:53 PM, Meeraj Kunnumpurath wrote:

> Hi,
>
> I have couple of ROA related questions, I would greatly appreciate someone can shed some light on.
>
> 1. I have a URL that can be accessed by mutually exclusive paths. For example, a client may search for all the employee by firstName some times and lastName some other times. What would be the best way to model path parameters on GET without introducing a hybrid RPC model, from a REST perspective? for example. /employee/{firstName} and /employee/{lastName} are indistinguishable from each other. Or would one use query parameters? Are query parameters in general considered as an anti-pattern in ROA?
>
> 2. I have an order entry system where users add line items to an order. First time a line item is added an order should be created, subsequent line items are then added to the created order. Based on this I have a resource for order and one for line item. My client is using GWT. The first tine a line item is added I send a PUT on the order resource which returns an order Id, followed by a PUT on the line item resource which quotes the order id. Subsequent line item additions just do a PUT on the line item resource. Even though this works well, the first interaction of a a PUT each on order and line item result in two separate HTTP calls and hence are not transactionally atomic. Is there a better way to model the resources?
>
> Kind regards
> Meeraj