Keep in mind that GET, PUT, POST, and DELETE are methods/operations. Would you design a service-oriented solution that has only one method/operation? Not likely. The four methods are complementary, and you must use the method that's appropriate to the task required. To reiterate/consolidate what's been said a few times so far:

GET: retrieve a representation of the resource (a "safe" operation that makes no changes)
PUT: update the resource with a new representation (an idempotent operation)
POST: add additional state to the current representation (a non-idempotent operation)
DELETE: delete the current representation (an idempotent operation)

For the transfer of funds operation, there are multiple ways to model it. I would probably model the transfer as a more generic "transaction" rather than as a "transfer". One approach might be:

You have the following resources:
- Account1
- Account2
- TransactionTimeStamp

The banking application would effect a transfer of $100 from Account1 to Account2:
- POST Account1 (decrement by 100)
- POST Account2 (increment by 100)
- PUT TransactionTimeStamp

(Alternatively, you might have two resources to represent the transaction: Account1TransactionTimeStamp and Account2TransactionTimeStamp.)

Anne

On 7/3/06, Ashley at Metamaxim <[EMAIL PROTECTED]> wrote:

Anne wrote:
 
> The resource in question, here, is the Trade.  When the Trade is confirmed, you PUT "confirmed", and you POST to
> PartyA and PartyB (also resources) a link to the Trade resource.
The analogue in the "marry" case would be to PUT a "marriage contract" and POST a link to the two people involved. So are we obliged to model "marriage contract" to make the solution work? In this case it seems that the implementation is driving the modelling, which is not good in my book.
 
Consider a "transfer" of $100 from Account1 to Account2. Do we have to have the "transfer" as a resource?
 
Also, this solution implies that PUT and POST are complementary (i.e., in general, you need to use both) rather than alternative (i.e., you choose whether you want to use PUT or POST). Is that the case?
 
Rgds
Ashley


__._,_.___


SPONSORED LINKS
Computer software Computer aided design software Computer job
Soa Service-oriented architecture


YAHOO! GROUPS LINKS




__,_._,___

Reply via email to