Search |
||
REST and Java MEPosted by brunogh on August 12, 2008 at 8:45 PM PDT
REST (Representational State Tranfer) is an architecture. Basically, it refers to the way the resources, commonly called URIs (Uniform Resource Identifier), are organized in the World Wide Web to be accessed and manipulated over the HTPP, using its default characteristics, like, for example, been stateless, specifying mime types, etc. The REST concept is not a new thing. Roy Fielding, one of the fathers of HTTP, has described it in his thesis. Java people, lately, has started talking about RESTful Web Services after JSR 311. They, like other developers, were motivated by the fact that conventional Web Services (WS-*), that uses SOAP, WSDL, UDDI, whateverXYZ, can be heavy. Also, can be much heavier in a mobile! Just imagine you parsing a SOAP envelop that contains an encoded image and transfering (paying) all this overhead. I have noticed two groups of REST developers: the ones who defend the use of the 4 HTPP methods (PUT, DELETE, GET, POST) and the others who prefer the browser way (GET, POST). I am not going to discuss this here (although I think the first way is more interesting), but in Java ME you will have problems with the first approach. The interface javax.microedition.io.HttpConnection, used by GCF (Generic Connection Framework), just allows GET, POST and HEAD. Urgghh?! RESTful Web Services are usually consumed in JSON and/or XML. You can use both in Java ME, mixing together some interesting available solutions:
That's it for today! Let's take a rest! »
Related Topics >>
Mobile and Embedded Comments
Comments are listed in date ascending order (oldest first)
Submitted by brunogh on Wed, 2008-08-13 11:25.
Cheers!
I forgot to mention, but there are other projects that makes HTTP connections. Usually, people has its own utility classes that deals with GCF too.
Submitted by eortiz on Wed, 2008-08-13 21:16.
Bruno -
MIDP3 includes all 5 HTTP methods (GET, HEAD, DELETE, PUT, POST), added specifically to support RESTful; I'm proud to say that was one of my contributions to MIDP3. Also, I have written an article on JSON on MIDP; that article should come up at the Sun mobility site maybe in a couple of weeks; keep an eye on that one.
ceo
Submitted by brunogh on Thu, 2008-08-14 06:45.
Hello enrique, thanks for the comment! Looking for that article too!
Submitted by guilherme_lopes on Sun, 2008-09-07 14:59.
Mobile Ajax seems to be awesome.
Did you test it?
regards
|
||
|
|
Nice write-up. Thanks!
-- Terrence