I'm currently in the process of developing a REST service that will be consumed by an iPhone app. Basically, the service wraps existing business logic. This business logic is written in c# and I'm writing the service in c#. From a purely curious point of view (not this project) my questions are: What other languages and frameworks exist to build REST services? If the technology choice was open which one would you choose and why? Can you wrap c# assemblies using non Microsoft languages? Would you ever do it? (If the development team was able to support it)
|
If you could choose your language freely, it's always a good idea to use the same language on the client and on the server. For example, when you build a RESTful webservice in Java, and an Android client that uses it, you could share some of the code. Sadly, the iPhone uses Objective-C and nobody wants to use that, certainly not on the server side. But I would guess, most of the time, people just use the language they know best, because it's mostly the fastest and most save way to go. |
|||||||
|
|
There are 2 .Net frameworks you could look at to help you, so you can still leverage your C# and get a leg up from a framework: WCF has a Rest Starter Kit which does what it says. Great if you either already use WCF or may need to extend your API to support SOAP etc. An alternative, which we have used very successfully, is to use the ASP.Net MVC Framework to build out a REST API. This works pretty well. There is a lot of info on the web to look at, but Phil Haack's blog would be a good place to start. |
|||||
|
|
For REST services today, I'd seriously consider Node.js. It may be fashionable but, it has a few aspects that make it the "right tool" for the job. First, it is designed to do this. No general purpose genericity and add-on stuff. Its designed for high-throughput, heavy I/O data manipulation. This does mean its not good for high-performance processing, but then you'll choose another tool for that, namely C/C++ and link or connect that to the node server. (which is easy BTW) Secondly, it uses the same language as the client - you'll be writing javascript clients to access this from a web client, so keeping the server in the same language helps development productivity. Consider libraries such as restify or express that help client and server programming and you've got a REST API system in next to no time. |
|||
|
|