views:

14

answers:

0

Hi, lately one person in my company suggested a different approach to web API. Since we deal with a lot of transactional processes (product sales, devices provisioning, account reconfiguration, billing, ...), the idea was to switching from "one action per request", to "process per request". For example instead of sending: (trivial mockup):

* first connection
<some wrapper>
  <request 1>params</request>
</some wrapper>
* maybe rollback here if it failed
* second connection
<some wrapper>
  <request 2>params</request>
</some wrapper>

He thinks about doing:

<some protocol wrapper>
  <request 1>...
  <request 2>...
  <request 3>...
</some protocol wrapper>

with the dispatcher being intelligent enough to issue a rollback to request 1 if request 2 fails. Each action should have its own rollback built-in.

This is not implemented in any way so far, I'm just trying to collect some feedback. Have you seen it used anywhere? Does this work? Do you see any issues with it straight-away?