A POST is a CREATE and a PUT is an UPDATE from the client’s perspective. It has been a long time since I read it, but I think the book here, in my opinion is deviating from “in practice”, because “in practice” the way writes are handled and backing storage schemas have nothing to do with the schema contract on the front end. Consider a geographically sharded database. We can’t expect the REST client to be smart enough to determine where we’re going to store data, but we may leverage properties in the front end schema or its HTTP wrapper to help make that determination.
The way you are talking about REST here is more of an OData implementation. OData is a CRUD framework on top of rest where the storage implementation and the REST schema contracts line up. There are data-focused services like this and there are workstream (application) focused services that are views of back end data. This book does not differentiate between the two, but “in practice” (again), you build your interface to satisfy an audience. Putting an OData schema on a coffee service would not make sense, because over time you will be sending far more fields than you actually need, and it will shift your business logic to the front end (danger). Use storage-specified schemas such as OData for back-end integration services and build custom application-scoped schemas to meet front-end needs.
Hope this helps!
--
You received this message because you are subscribed to the Google Groups "restinpractice" group.
To unsubscribe from this group and stop receiving emails from it, send an email to
restinpractic...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/restinpractice/dcabc454-06bb-4043-b751-0a1c1a97729f%40googlegroups.com.
A POST is a CREATE and a PUT is an UPDATE from the client’s perspective
To unsubscribe from this group and stop receiving emails from it, send an email to restinp...@googlegroups.com.
“In Practice” is the key. In practice, you need to make implementation decisions that solve both front **and** back end problems, and you don’t always get the call when you’re building other people’s apps. Look at REST as a front end spec, and think of these HTTP methods more aspirational – how you want the client to perceive the transaction.
Remember that REST is an architectural style, not a strict implementation protocol. There is not one correct REST way. I think you’ll benefit from digging into Fielding’s original work (http://www.ics.uci.edu/~fielding/pubs/dissertation/rest_arch_style.htm), particularly his commentary on layered implementations. A front-end GET, POST, etc does not impose some kind of regulatory requirement on the back end. Also please note that Fielding’s [great] early work does not address modern topics like schema versioning and client-side vulnerabilities, and so we are left to our own devices to deal with these kinds of things.
If you need a strict protocol, look into OData or (lord help you) SOAP.
To unsubscribe from this group and stop receiving emails from it, send an email to
restinpractic...@googlegroups.com.
To view this discussion on the web visit
https://groups.google.com/d/msgid/restinpractice/5041dc87-c1e5-4991-8b4a-800fd11fecb6%40googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/restinpractice/5041dc87-c1e5-4991-8b4a-800fd11fecb6%40googlegroups.com.