users@jersey.java.net

Re: [Jersey] JAX-RS == REST? Or not? (was Re: [Jersey] What HATEOAS actually means)

From: Santiago Pericas-Geertsen <Santiago.Pericasgeertsen_at_Sun.COM>
Date: Thu, 18 Feb 2010 15:59:23 -0500

Markus,

 Again, I think this conversation is going nowhere. So, my last reply :)

>> It's unclear to me as well. As long a the service creates a resource
>> identifier for that cart (resource identification in REST), all the
>> client needs to do is use it in subsequent requests. In my view,
>> creating resources identifiers for things of interest is precisely how
>> you avoid relying on sessions. The service will associate that resource
>> identifier with objects stored in a database, and there's no need for
>> the client to store anything once it gets that resource identifier.
>
> If you want to put more items in the cart, the server must load the cart
> from the hard drive using your identifyer (the server must "remember"). That
> is what is called "stateFUL".

 We already agreed that this is resource state, not session state.

> Writing that SESSION information to disk and
> loading it back later will need lots of time and drive space (remember, your
> server might have to server lots of clients at any time).

 Again, this is not session state, it is the state of my business transaction. I may want to start a cart today, add items tomorrow and place the order in a month.

 There's nothing in the REST architecture that says that I need to do everything in "one shot" by storing all this info in the client first. If I can get a resource identifier from the server, as I described earlier, I should be able to refer to it in the future.

-- Santiago