When implementing REST based systems, REST purists balk at the idea of sending data through a POST and getting a response. They say "THATS NOT REST - GO USE SOAP INSTEAD".
My response is that resources don't have to be static pieces of data, similar to how variables can be closures. Take for example this resource "http://myresource/tax-calulator/calculate". This resource accepts requests with both the price & destination state and returns the calculated tax amount.
By embracing the fact that functions can be resources, you can do really interesting things. For example, lets say you want to create a resource that calculates taxes in NJ. You could simply create a new resource "http://myresource/tax-calulator/NJ/calculate" that always passes NJ as the destination to "http://myresource/tax-calulator/calculate". This paradigm does not violate REST at all.
I think once the REST community wraps there mind that resources can be functions too, REST can effectively replace other frameworks such as SOAP or XML-RPC
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment