Java Reference
In-Depth Information
Another key concept is Hypermedia as the Engine of Application State, which has the
truly unfortunate, unpronounceable acronym HATEOAS. Most REST advocates [ 5 ] I know
simply say “ hypermedia instead.
5 Often known, believe it or not, as RESTafarians.
The principles defined in this section are architectural and are thus independent of imple-
mentation language. In the next section I'll address [ 6 ] the Java-specific specification inten-
ded to implement RESTful services, JAX-RS.
6 Sorry.
9.2. The Java approach: JAX-RS
The Java EE specification includes the Java API for RESTful Services. Version 1.18 is
from JSR 311. The new version, 2.0, is an implementation of JSR 339 and was released in
May of 2013.
In this section I'll implement a set of CRUD methods on a simple POJO. [ 7 ] The JAX-RS
partdoesn'tdependonthis,soI'lldiscussthatseparately.I'llstart withthebasic infrastruc-
ture and then move to REST.
7 Yes, that's a URL-driven database, and yes, that violates hypermedia principles. I promise to get to that later.
What do Java developers actually use for REST?
In this topic I normally start with what Java developers use for a particular problem, then
show how Groovy can help the Java implementations, and finally discuss what Groovy of-
fers as an alternative. When I describe what Java developers typically use, I default to what
the Java SE or EE specification provides.
That's not the case with REST. In addition to the spec, JAX-RS, Java developers use
several third-party alternatives. Among the most popular are Restlet ( http://restlet.org/ ) ,
RestEasy ( www.jboss.org/resteasy ) , and Restfulie ( http://restfulie.caelum.com.br/ ) , and
there are other alternatives as well. [ 8 ] It's hard at this point to know which, if any, is going
to be the REST framework of choice for Java developers in a few years. [ 9 ]
 
 
 
Search WWH ::




Custom Search