OASIS Mailing List ArchivesView the OASIS mailing list archive below
or browse/search using MarkMail.

 


Help: OASIS Mailing Lists Help | MarkMail Help

 


 

   Re: [xml-dev] A question about REST and transaction isolation

[ Lists Home | Date Index | Thread Index ]

David Megginson <dmeggin@attglobal.net> writes:

> K. Ari Krupnikov wrote:
> 
> > Suppose I want to build a RESTful interface to an ACID system. I want
> > to allow the user to incrementally change the state of the system, but
> > only "commit" the changes when he is satisfied with their sum. I
> > imagine a user GETting a resource, POSTing some changes to it which
> > may have side effects on other resources, GETting other resources to
> > observe the side effects, and eventually committing to the changes or
> > rejecting them.
> 
> If the scope of the potential side effects is small and well-defined,
> you might be able to reduce everything to a single exchange: get all
> of the potentially-affected state to the client in a single XML
> document (or collection of XML documents), allow the client to make
> changes locally until satisfied, then post the modified state back to
> the server.  Since modifications live on the client side until
> committed, there is no need to come up with any separate URL scheme.

You are talking about a very thick client here. It's not how much
state there is this application (not much), it's how much logic there
is (a lot). The server already knows how to do this logic. I don't
want to duplicate the logic on the client. I want to use a browser,
and I don't want a ton of JavaScript to handle the state
client-side. A full-blown Java client is a future possibility, but
again, I'd like to keep the business logic in it to a minimum. I
definitively don't want three separate codebases for business logic,
one on the server one in JavaScript (possibly in multiple versions for
different browsers) and one in a Java client.

Client does presentation, server does business logic. Is that not in
line with REST?

> This approach would work for, say, a movie database, where the user
> might check out a full movie description to change the director's
> name, then check the entire description in again.  It might not work
> so well for, say, a geographical database, where a modification to a
> shoreline may also require corrections to landuse data, roads and
> railroads, and so on, in no easily-predictable way.
> 
> It is entirely possibly that your project is one in the second
> category, but I wouldn't give up on the simpler approach until it were
> proven inadequate. Stupid-and-easy usually wins: moving 50K of XML
> each way once can be much more efficient than many 100 byte
> transactions.

It's not about reducing redundant traffic, it's about reducing
redundant logic. One node should know how to do a process, be the
final authority and bear the ultimate responsibility for that process.

Ari.

-- 
Elections only count as free and trials as fair if you can lose money
betting on the outcome.




 

News | XML in Industry | Calendar | XML Registry
Marketplace | Resources | MyXML.org | Sponsors | Privacy Statement

Copyright 2001 XML.org. This site is hosted by OASIS