0

I'm thinking about implementing a server for remotecontrolling a device as a RESTful service. Unlike most restful services known from the web it could only serve one client in a meaningful way at a time. Do you think that REST is still a valid option or would you see this single-user, session-based scenario as a sign to choose another way to interact remotely?

h0b0
  • 1,802
  • 1
  • 25
  • 44

2 Answers2

2

You could certainly follow many of the principles behind a REST architecture for your service, but it doesn't sounds like you really need most of them. REST is better suited for larger long lived systems with lots of disparate clients.

Now, HTTP, on the other hand, could easily be leveraged to create simple service for you needs. But, HTTP != REST. REST is an architecture, HTTP is a protocol.

Will Hartung
  • 115,893
  • 19
  • 128
  • 203
  • REST was developed in parallel with the HTTP 1.1 protocol. Most every HTTP call will technically be restful. You are factually correct in your last three sentences, but I think in most cases you'd find that it would be restful even if it was unintended. – corsiKa Oct 17 '11 at 17:29
  • 1
    No, hardly. HTTP is a protocol that happens to be well suited to the REST architecture, but by no means is every HTTP call even remotely RESTful. The glaring examples of both XML-RPC and SOAP over HTTP comes to mind. – Will Hartung Oct 17 '11 at 22:13
  • I think you'll also find that, in terms of the number of HTTP calls made, those are a stark minority. I did not say all, I said most. I stand by the fact that most HTTP calls (including virtually every one over the web) are restful. In fact, as simple as his service is, it is likely going to be (as I mentioned in my first comment) restful even if he doesn't specifically try to make it so if he uses HTTP. – corsiKa Oct 17 '11 at 23:48
1

The fact that it's so easy to implement is a win in my books. You can get rest services running in a matter of minutes to hours, depending on your expertise and framework choice, etc. It's very simple to consume with a variety of interfaces, giving it more points. When your service transitions into servicing multiple clients at a time, it becomes only more extensible and in your favor to have it.

There are other alternatives, but to me this seems like a perfectly valid route to take.

corsiKa
  • 81,495
  • 25
  • 153
  • 204