Tuesday, February 21, 2012

APIs in general

Just had a thought today that might be worth keeping. I've been thinking about Web-based APIs and how to use them in Decl, and it occurred to me that really the way I do databases is a decent way to think of APIs. In other words, once I've defined (and named) an API, I should simply be able to refer to it and have a session automagically created. But if I want to create multiple sessions, then I do that in a separate instantiation step.

Once I've defined an API in a module somewhere, then I should then be able to write quick scripts against it very quickly and easily. I hope this makes sense when I read it later.

Update: Here's a nice example of how a Perl RESTful API class can look: ElasticSearch.

No comments:

Post a Comment