Recommended: Sing it, brah! 5 fabulous songs for developers
JW's Top 5
Optimize with a SATA RAID Storage Solution
Range of capacities as low as $1250 per TB. Ideal if you currently rely on servers/disks/JBODs
Page 3 of 7
Most distributed systems offer an architect only three options for exposing the data of a resource:
According to Fielding, REST provides a hybrid of these three data-rendering options by "focusing on a shared understanding of data types with metadata, but limiting the scope of what is revealed to a standardized interface."
Data elements in REST are summarized as:
REST components act on a resource by using a URI-based representation to acquire a snapshot of the current state of the resource and transmitting that snapshot between components. A representation in REST is defined as a sequence of bytes, plus representation metadata describing those bytes. The format of a resource representation is defined by its MIME or media type. It is this key aspect of REST that makes JAF and the MIME-defined aspects of JAF such great facilitators of a REST data-element implementation.
Now that you've learned a bit about REST and JAF, we'll look at a sample Web application that tracks REST-based requests and responses through a simple Java servlet-based system.
In the next sections I will develop a REST implementation using JAF. I'll start by modeling a simple system of components around the primary entities defined by REST, after which I'll construct a Java application using servlets and JAF. For now, consider the class diagram in Figure 3, which offers a high-level view of the Java classes and interfaces that make up the JAF-based REST implementation for the sample application.
As the class diagram shows, a FrontController servlet interacts with most of the primary REST entities, which are represented as Java interfaces. The following sections
discuss each of the primary REST entities and the Java components that represent them.