REST and SQL
Imperative programming has ruined us all.
Analogy: ...within databases, you will likely find that something like SQL is great for queries, but you want to step back into the [stored] procedure world for updates.[Sam Ruby]
This is a pretty good analogy because SQL is a unbelievably limited query language just as REST is an unbelievably limited, er, whatever it is supposed to be.[Patrick Logan]
This is a terrible analogy. Don't stored procedures contain SQL? This is like saying that we should prefer Java over HTTP because you can write a simple Java method to fetch a Web resource.
The conceptual API to a database consists of SELECT, INSERT, UPDATE, and DELETE. The conceptual API to the Web consists of GET, PUT, POST, and DELETE. Notice the similiarites? Tuple spaces have similiarly generic interfaces.
When implementing systems that use a database, the Web, or tuple spaces, you can (and should) encapsulate the code that interfaces with those systems into functions or classes or whatever but that doesn't mean that these systems' "native" API isn't powerful enough. It's their genericity that makes them so powerful!
3:32:48 PM
|