I was recently reading the Wikipedia article for Resource-Oriented Architectures (ROA) and stumbled across an article that made the assertion that, although REST is a technology that is very-well suited for web applications and web services, that it is nevertheless a standalone technology that can be used in non-web applications.

This is the first I've ever heard of such a thing! I thought REST was a SOAP competitor, but that the two were strictly web service solutions.

My question: can someone provide an example for how REST is used in something that isn't a web app? Like a Swing client, or a command line tool, or an EJB.

Your confusion is understandable. While some REST concepts are easy to understand and comply with (e.g. use of common verbs such as POST, GET, etc), other concepts are still baffling people. According to Roy Fielding, REST APIs must be hypertext-driven; anything else is simply not REST. He also has pretty strong opinions on how a RESTful API must be discovered by the client.
–
Andres F.Feb 5 '12 at 0:48

3

How do define "web app"? Is a desktop client that accesses a server via the internet using a RESTful interface a web app?
–
Bryan OakleyFeb 5 '12 at 1:34

2 Answers
2

I used a REST API for a communications server that was used in a radio devices. I'd say SMTP is a REST API too (ie you connect to a resource on port 25 and have verbs like MAILTO, SEND, TO, etc to build up a message)

In the past I would have thought the same, but according to Roy Fielding, who first described the REST architecture, hypermedia is a mandatory requirement of REST. Also note that no-one besides Fielding seems to know exactly what REST means.
–
Andres F.Feb 5 '12 at 0:42

I think SMTP isn't a good example, because the server has intermittent state, which is much more core to common uses of REST than the hypermedia point. The whole point is that there's many resources, with few verbs. SMTP, by your description, has many verbs on a single resource.
–
skrebbelApr 10 '13 at 13:08

I'm not aware of a good non-HTTP-based protocol example that fits the "many resources, few verbs; transfer all state" aspects of REST.

However, plain ROA/HTTP-style REST is used in plenty places outside the web itself. For example, I've been involved in the development of software for an industrial LED production machine, where the various components communicated with one another (within the same computer, and over an internal network between controllers inside the machine) via plain common HTTP-ish REST.

The non-realtime parts of the controller code were written in C#, and I believe one of Microsoft's WCF incarnations was used to make RESTful endpoints. Using plain HTTP and resources made debugging and message logging a charm, since all web-enabled tools (curl, browser, Fiddler2, http logs) were at our disposal.