another REST fragments idea

2008-02-23 @ 16:35#

Simon St. Laurent has poasted an article this is yet another way to address partial updates of a single document in a REST-ful way. it's an interesting approach:

To let the server know that something was directed toward that same set of titles, the query string syntax might look like:
http://simonstl.com/book.xml?XML-XPTR=xpath1(//book/chapter/title)
A server might then return just the titles, or perform an operation on those title elements if a verb other than GET was used. (Be very careful with identifiers that reference multiple fragments!)

this starts to look quite a bit like T-SQL patterns and that's not a bad thing.

as is mentioned in the piece, XML documents are not at all like database rows. there are a number of complications to deal with. among them, in my mind is the notion of atmoicity. database rows offer a degree of isolation that XML documents rarely can provide. what happens when more than one person is updating the XML document? ETags can get you part-way there, but they are not the answer.

ultimately, i think a binary diff is the only really safe way to go on this. lots of work has been done in the diff space (mostly for versioning tools) and i suspect that's the kind of technology that is needed here, too.

code